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

Public Member Functions

 testGetSource ()
 legacy More...
 
 testGetSourceWhenTemplateDoesNotExist ()
 legacy Twig_Error_Loader More...
 
 testGetSourceContextWhenTemplateDoesNotExist ()
 Twig_Error_Loader More...
 
 testGetCacheKey ()
 
 testGetCacheKeyWhenTemplateHasDuplicateContent ()
 
 testGetCacheKeyIsProtectedFromEdgeCollisions ()
 
 testGetCacheKeyWhenTemplateDoesNotExist ()
 Twig_Error_Loader More...
 
 testSetTemplate ()
 
 testIsFresh ()
 
 testIsFreshWhenTemplateDoesNotExist ()
 Twig_Error_Loader More...
 
 testTemplateReference ()
 

Detailed Description

Definition at line 12 of file ArrayTest.php.

Member Function Documentation

◆ testGetCacheKey()

Twig_Tests_Loader_ArrayTest::testGetCacheKey ( )

Definition at line 45 of file ArrayTest.php.

References $loader, and array.

46  {
47  $loader = new Twig_Loader_Array(array('foo' => 'bar'));
48 
49  $this->assertEquals('foo:bar', $loader->getCacheKey('foo'));
50  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testGetCacheKeyIsProtectedFromEdgeCollisions()

Twig_Tests_Loader_ArrayTest::testGetCacheKeyIsProtectedFromEdgeCollisions ( )

Definition at line 63 of file ArrayTest.php.

References $loader, and array.

64  {
66  'foo__' => 'bar',
67  'foo' => '__bar',
68  ));
69 
70  $this->assertEquals('foo__:bar', $loader->getCacheKey('foo__'));
71  $this->assertEquals('foo:__bar', $loader->getCacheKey('foo'));
72  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testGetCacheKeyWhenTemplateDoesNotExist()

Twig_Tests_Loader_ArrayTest::testGetCacheKeyWhenTemplateDoesNotExist ( )

Twig_Error_Loader

Definition at line 77 of file ArrayTest.php.

References $loader, and array.

78  {
80 
81  $loader->getCacheKey('foo');
82  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testGetCacheKeyWhenTemplateHasDuplicateContent()

Twig_Tests_Loader_ArrayTest::testGetCacheKeyWhenTemplateHasDuplicateContent ( )

Definition at line 52 of file ArrayTest.php.

References $loader, and array.

53  {
55  'foo' => 'bar',
56  'baz' => 'bar',
57  ));
58 
59  $this->assertEquals('foo:bar', $loader->getCacheKey('foo'));
60  $this->assertEquals('baz:bar', $loader->getCacheKey('baz'));
61  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testGetSource()

Twig_Tests_Loader_ArrayTest::testGetSource ( )

legacy

Definition at line 17 of file ArrayTest.php.

References $loader, and array.

18  {
19  $loader = new Twig_Loader_Array(array('foo' => 'bar'));
20 
21  $this->assertEquals('bar', $loader->getSource('foo'));
22  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testGetSourceContextWhenTemplateDoesNotExist()

Twig_Tests_Loader_ArrayTest::testGetSourceContextWhenTemplateDoesNotExist ( )

Twig_Error_Loader

Definition at line 38 of file ArrayTest.php.

References $loader, and array.

39  {
41 
42  $loader->getSourceContext('foo');
43  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testGetSourceWhenTemplateDoesNotExist()

Twig_Tests_Loader_ArrayTest::testGetSourceWhenTemplateDoesNotExist ( )

legacy Twig_Error_Loader

Definition at line 28 of file ArrayTest.php.

References $loader, and array.

29  {
31 
32  $loader->getSource('foo');
33  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testIsFresh()

Twig_Tests_Loader_ArrayTest::testIsFresh ( )

Definition at line 92 of file ArrayTest.php.

References $loader, array, and time.

93  {
94  $loader = new Twig_Loader_Array(array('foo' => 'bar'));
95  $this->assertTrue($loader->isFresh('foo', time()));
96  }
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Loads a template from an array.
Definition: Array.php:26

◆ testIsFreshWhenTemplateDoesNotExist()

Twig_Tests_Loader_ArrayTest::testIsFreshWhenTemplateDoesNotExist ( )

Twig_Error_Loader

Definition at line 101 of file ArrayTest.php.

References $loader, array, and time.

102  {
104 
105  $loader->isFresh('foo', time());
106  }
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Loads a template from an array.
Definition: Array.php:26

◆ testSetTemplate()

Twig_Tests_Loader_ArrayTest::testSetTemplate ( )

Definition at line 84 of file ArrayTest.php.

References $loader, and array.

85  {
87  $loader->setTemplate('foo', 'bar');
88 
89  $this->assertEquals('bar', $loader->getSourceContext('foo')->getCode());
90  }
Create styles array
The data for the language used.
Loads a template from an array.
Definition: Array.php:26

◆ testTemplateReference()

Twig_Tests_Loader_ArrayTest::testTemplateReference ( )

Definition at line 108 of file ArrayTest.php.

References $loader, $name, array, and time.

109  {
111  $loader = new Twig_Loader_Array(array('foo' => 'bar'));
112 
113  $loader->getCacheKey($name);
114  $loader->getSourceContext($name);
115  $loader->isFresh($name, time());
116  $loader->setTemplate($name, 'foo:bar');
117 
118  // add a dummy assertion here to satisfy PHPUnit, the only thing we want to test is that the code above
119  // can be executed without crashing PHP
120  $this->addToAssertionCount(1);
121  }
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Loads a template from an array.
Definition: Array.php:26

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