Skip to content

Commit

Permalink
updated two tests to use the test plugin on the filesystem rather tha…
Browse files Browse the repository at this point in the history
…n Ping
dotEvan committed Mar 18, 2010
1 parent e1d4213 commit 3d2756f
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Tests/Phergie/Plugin/HandlerTest.php
Original file line number Diff line number Diff line change
@@ -277,6 +277,10 @@ public function testAddPluginThrowsExceptionIfPluginNotInstantiable()
$this->fail('An expected exception has not been raised.');
}

/**
* @todo add a tests for using addPlugin with a shortname and args
*/

/**
* implements __isset
*
@@ -307,9 +311,12 @@ public function testPluginHandlerImplementsIsset()
*/
public function testAddPluginReturnsSamePluginWhenAskedTwice()
{
$plugin1 = $this->handler->addPlugin('Ping');
$plugin2 = $this->handler->addPlugin('Ping');
$this->assertEquals($plugin1, $plugin2);
$plugin_name = 'TestPluginFromFile';
$this->handler->addPath(dirname(__FILE__), 'Phergie_Plugin_');

$plugin1 = $this->handler->addPlugin($plugin_name);
$plugin2 = $this->handler->addPlugin($plugin_name);
$this->assertSame($plugin1, $plugin2);
}


@@ -322,8 +329,10 @@ public function testAddPluginReturnsSamePluginWhenAskedTwice()
*/
public function testExceptionThrownWhenLoadingPluginWithoutAutoload()
{
$this->handler->addPath(dirname(__FILE__), 'Phergie_Plugin_');

try {
$this->handler->getPlugin('Ping');
$this->handler->getPlugin('TestPluginFromFile');
} catch (Phergie_Plugin_Exception $expected) {
$this->assertEquals(
Phergie_Plugin_Exception::ERR_PLUGIN_NOT_LOADED,

0 comments on commit 3d2756f

Please sign in to comment.