ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Tests_ContainerRuntimeLoaderTest Class Reference
+ Inheritance diagram for Twig_Tests_ContainerRuntimeLoaderTest:
+ Collaboration diagram for Twig_Tests_ContainerRuntimeLoaderTest:

Public Member Functions

 testLoad ()
 @requires PHP 5.3 More...
 
 testLoadUnknownRuntimeReturnsNull ()
 @requires PHP 5.3 More...
 

Detailed Description

Definition at line 12 of file ContainerRuntimeLoaderTest.php.

Member Function Documentation

◆ testLoad()

Twig_Tests_ContainerRuntimeLoaderTest::testLoad ( )

@requires PHP 5.3

Definition at line 17 of file ContainerRuntimeLoaderTest.php.

18 {
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());
22
24
25 $this->assertInstanceOf('stdClass', $loader->load('stdClass'));
26 }
Lazily loads Twig runtime implementations from a PSR-11 container.
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
$container
Definition: wac.php:13

References $container, and Sabre\Event\once().

+ Here is the call graph for this function:

◆ testLoadUnknownRuntimeReturnsNull()

Twig_Tests_ContainerRuntimeLoaderTest::testLoadUnknownRuntimeReturnsNull ( )

@requires PHP 5.3

Definition at line 31 of file ContainerRuntimeLoaderTest.php.

32 {
33 $container = $this->getMockBuilder('Psr\Container\ContainerInterface')->getMock();
34 $container->expects($this->once())->method('has')->with('Foo');
35 $container->expects($this->never())->method('get');
36
38 $this->assertNull($loader->load('Foo'));
39 }

References $container, and Sabre\Event\once().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: