added missing unit test
This commit is contained in:
parent
0380d1456a
commit
47d1592b56
@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
|
||||||
|
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
|
||||||
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||||
@ -151,6 +152,16 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE));
|
$this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::get
|
||||||
|
*/
|
||||||
|
public function testGetReturnsNullOnInactiveScopeWhenServiceIsCreatedByAMethod()
|
||||||
|
{
|
||||||
|
$builder = new ProjectContainer();
|
||||||
|
|
||||||
|
$this->assertNull($builder->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds
|
* @covers Symfony\Component\DependencyInjection\ContainerBuilder::getServiceIds
|
||||||
*/
|
*/
|
||||||
@ -805,8 +816,16 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertEquals(true, $classInList);
|
$this->assertTrue($classInList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class FooClass {}
|
class FooClass {}
|
||||||
|
|
||||||
|
class ProjectContainer extends ContainerBuilder
|
||||||
|
{
|
||||||
|
public function getFoobazService()
|
||||||
|
{
|
||||||
|
throw new InactiveScopeException('foo', 'request');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user