19 $container = $this->getMockBuilder(
'Psr\Container\ContainerInterface')->getMock();
20 $container->expects($this->
once())->method(
'has')->with(
'stdClass')->willReturn(
true);
21 $container->expects($this->
once())->method(
'get')->with(
'stdClass')->willReturn(
new stdClass());
25 $this->assertInstanceOf(
'stdClass', $loader->load(
'stdClass'));
33 $container = $this->getMockBuilder(
'Psr\Container\ContainerInterface')->getMock();
35 $container->expects($this->never())->method(
'get');
38 $this->assertNull($loader->load(
'Foo'));
An exception for terminatinating execution or to throw for unit testing.
Lazily loads Twig runtime implementations from a PSR-11 container.
testLoadUnknownRuntimeReturnsNull()
@requires PHP 5.3
testLoad()
@requires PHP 5.3
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.