ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Tests_SimpleTokenParserTest Class Reference

legacy More...

+ Inheritance diagram for Twig_Tests_SimpleTokenParserTest:
+ Collaboration diagram for Twig_Tests_SimpleTokenParserTest:

Public Member Functions

 testParseGrammar ($str, $grammar)
 getTests More...
 
 testParseGrammarExceptions ()
 
 getTests ()
 

Detailed Description

legacy

Definition at line 15 of file SimpleTokenParserTest.php.

Member Function Documentation

◆ getTests()

Twig_Tests_SimpleTokenParserTest::getTests ( )

Definition at line 49 of file SimpleTokenParserTest.php.

References Twig_Token\PUNCTUATION_TYPE.

50  {
51  return array(
52  array('', new Twig_Extensions_Grammar_Tag()),
53  array('const', new Twig_Extensions_Grammar_Tag(
55  )),
56  array(' const ', new Twig_Extensions_Grammar_Tag(
58  )),
59  array('<expr>', new Twig_Extensions_Grammar_Tag(
61  )),
62  array('<expr:expression>', new Twig_Extensions_Grammar_Tag(
64  )),
65  array(' <expr:expression> ', new Twig_Extensions_Grammar_Tag(
67  )),
68  array('<nb:number>', new Twig_Extensions_Grammar_Tag(
70  )),
71  array('<bool:boolean>', new Twig_Extensions_Grammar_Tag(
73  )),
74  array('<content:body>', new Twig_Extensions_Grammar_Tag(
75  new Twig_Extensions_Grammar_Body('content')
76  )),
77  array('<expr:expression> [with <arguments:array>]', new Twig_Extensions_Grammar_Tag(
81  new Twig_Extensions_Grammar_Array('arguments')
82  )
83  )),
84  array(' <expr:expression> [ with <arguments:array> ] ', new Twig_Extensions_Grammar_Tag(
88  new Twig_Extensions_Grammar_Array('arguments')
89  )
90  )),
91  array('<expr:expression> [with <arguments:array> [or <optional:expression>]]', new Twig_Extensions_Grammar_Tag(
95  new Twig_Extensions_Grammar_Array('arguments'),
99  )
100  )
101  )),
102  array('<expr:expression> [with <arguments:array> [, <optional:expression>]]', new Twig_Extensions_Grammar_Tag(
106  new Twig_Extensions_Grammar_Array('arguments'),
109  new Twig_Extensions_Grammar_Expression('optional')
110  )
111  )
112  )),
113  );
114  }
const PUNCTUATION_TYPE
Definition: Token.php:36

◆ testParseGrammar()

Twig_Tests_SimpleTokenParserTest::testParseGrammar (   $str,
  $grammar 
)

getTests

Definition at line 20 of file SimpleTokenParserTest.php.

References Twig_Extensions_SimpleTokenParser\parseGrammar().

21  {
22  $this->assertEquals($grammar, Twig_Extensions_SimpleTokenParser::parseGrammar($str), '::parseGrammar() parses a grammar');
23  }
static parseGrammar($str, $main=true)
+ Here is the call graph for this function:

◆ testParseGrammarExceptions()

Twig_Tests_SimpleTokenParserTest::testParseGrammarExceptions ( )

Definition at line 25 of file SimpleTokenParserTest.php.

References Twig_Extensions_SimpleTokenParser\parseGrammar().

26  {
27  try {
29  $this->fail();
30  } catch (Exception $e) {
31  $this->assertEquals('Twig_Error_Runtime', get_class($e));
32  }
33 
34  try {
36  $this->fail();
37  } catch (Exception $e) {
38  $this->assertEquals('Twig_Error_Runtime', get_class($e));
39  }
40 
41  try {
43  $this->fail();
44  } catch (Exception $e) {
45  $this->assertEquals('Twig_Error_Runtime', get_class($e));
46  }
47  }
static parseGrammar($str, $main=true)
+ Here is the call graph for this function:

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