add test for non-function loader in plugin factory.

This commit is contained in:
Steve B 2013-11-28 14:12:50 +00:00 committed by steve.brazier
parent 74df61cd6c
commit aca6af3fec

View file

@ -37,10 +37,16 @@ class FactoryTest extends \PHPUnit_Framework_TestCase {
public function testRegisterResourceThrowsExceptionWithoutTypeAndName()
{
$this->setExpectedException("InvalidArgumentException");
$this->setExpectedException('InvalidArgumentException', 'Type or Name must be specified');
$this->testedFactory->registerResource($this->resourceLoader, null, null);
}
public function testRegisterResourceThrowsExceptionIfLoaderIsntFunction()
{
$this->setExpectedException('InvalidArgumentException', '$loader is expected to be a function');
$this->testedFactory->registerResource(array("dummy"), "TestName", "TestClass");
}
public function testBuildPluginWorksWithConstructorlessPlugins()
{
$namespace = '\\PHPCI\\Plugin\\Tests\\Util\\';