ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Tests_ContainerRuntimeLoaderTest Class Reference
+ Inheritance diagram for Twig_Tests_ContainerRuntimeLoaderTest:
+ Collaboration diagram for Twig_Tests_ContainerRuntimeLoaderTest:

Public Member Functions

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

Detailed Description

Definition at line 12 of file ContainerRuntimeLoaderTest.php.

Member Function Documentation

◆ testLoad()

Twig_Tests_ContainerRuntimeLoaderTest::testLoad ( )

PHP 5.3

Definition at line 17 of file ContainerRuntimeLoaderTest.php.

References $container, and $loader.

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.
$container
Definition: wac.php:13

◆ testLoadUnknownRuntimeReturnsNull()

Twig_Tests_ContainerRuntimeLoaderTest::testLoadUnknownRuntimeReturnsNull ( )

PHP 5.3

Definition at line 31 of file ContainerRuntimeLoaderTest.php.

References $container, and $loader.

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  }
Lazily loads Twig runtime implementations from a PSR-11 container.
$container
Definition: wac.php:13

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