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

Public Member Functions

 testGetArguments ()
 
 testGetArgumentsWhenPositionalArgumentsAfterNamedArguments ()
 Twig_Error_Syntax Positional arguments cannot be used after named arguments for function "date". More...
 
 testGetArgumentsWhenArgumentIsDefinedTwice ()
 Twig_Error_Syntax Argument "format" is defined twice for function "date". More...
 
 testGetArgumentsWithWrongNamedArgumentName ()
 Twig_Error_Syntax Unknown argument "unknown" for function "date(format, timestamp)". More...
 
 testGetArgumentsWithWrongNamedArgumentNames ()
 Twig_Error_Syntax Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)". More...
 
 testResolveArgumentsWithMissingValueForOptionalArgument ()
 Twig_Error_Syntax Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length". More...
 
 testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction ()
 
 testGetArgumentsForStaticMethod ()
 
 testResolveArgumentsWithMissingParameterForArbitraryArguments ()
 LogicException The last parameter of "Twig_Tests_Node_Expression_CallTest::customFunctionWithArbitraryArguments" for function "foo" must be an array with default value, eg. More...
 
 customFunction ($arg1, $arg2='default', $arg3=array())
 
 customFunctionWithArbitraryArguments ()
 
 testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction ()
 LogicException #^The last parameter of "custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg. More...
 
 testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject ()
 LogicException #^The last parameter of "CallableTestClass\:\:__invoke" for function "foo" must be an array with default value, eg. More...
 

Static Public Member Functions

static customStaticFunction ($arg1, $arg2='default', $arg3=array())
 

Detailed Description

Definition at line 12 of file CallTest.php.

Member Function Documentation

◆ customFunction()

Twig_Tests_Node_Expression_CallTest::customFunction (   $arg1,
  $arg2 = 'default',
  $arg3 = array() 
)

Definition at line 97 of file CallTest.php.

98  {
99  }

◆ customFunctionWithArbitraryArguments()

Twig_Tests_Node_Expression_CallTest::customFunctionWithArbitraryArguments ( )

Definition at line 101 of file CallTest.php.

102  {
103  }

◆ customStaticFunction()

static Twig_Tests_Node_Expression_CallTest::customStaticFunction (   $arg1,
  $arg2 = 'default',
  $arg3 = array() 
)
static

Definition at line 93 of file CallTest.php.

94  {
95  }

◆ testGetArguments()

Twig_Tests_Node_Expression_CallTest::testGetArguments ( )

Definition at line 14 of file CallTest.php.

References array.

15  {
16  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date'));
17  $this->assertEquals(array('U', null), $node->getArguments('date', array('format' => 'U', 'timestamp' => null)));
18  }
Create styles array
The data for the language used.

◆ testGetArgumentsForStaticMethod()

Twig_Tests_Node_Expression_CallTest::testGetArgumentsForStaticMethod ( )

Definition at line 77 of file CallTest.php.

References array.

78  {
79  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'custom_static_function'));
80  $this->assertEquals(array('arg1'), $node->getArguments(__CLASS__.'::customStaticFunction', array('arg1' => 'arg1')));
81  }
Create styles array
The data for the language used.

◆ testGetArgumentsWhenArgumentIsDefinedTwice()

Twig_Tests_Node_Expression_CallTest::testGetArgumentsWhenArgumentIsDefinedTwice ( )

Twig_Error_Syntax Argument "format" is defined twice for function "date".

Definition at line 34 of file CallTest.php.

References array.

35  {
36  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date'));
37  $node->getArguments('date', array('Y-m-d', 'format' => 'U'));
38  }
Create styles array
The data for the language used.

◆ testGetArgumentsWhenPositionalArgumentsAfterNamedArguments()

Twig_Tests_Node_Expression_CallTest::testGetArgumentsWhenPositionalArgumentsAfterNamedArguments ( )

Twig_Error_Syntax Positional arguments cannot be used after named arguments for function "date".

Definition at line 24 of file CallTest.php.

References array.

25  {
26  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date'));
27  $node->getArguments('date', array('timestamp' => 123456, 'Y-m-d'));
28  }
Create styles array
The data for the language used.

◆ testGetArgumentsWithWrongNamedArgumentName()

Twig_Tests_Node_Expression_CallTest::testGetArgumentsWithWrongNamedArgumentName ( )

Twig_Error_Syntax Unknown argument "unknown" for function "date(format, timestamp)".

Definition at line 44 of file CallTest.php.

References array.

45  {
46  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date'));
47  $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown' => ''));
48  }
Create styles array
The data for the language used.

◆ testGetArgumentsWithWrongNamedArgumentNames()

Twig_Tests_Node_Expression_CallTest::testGetArgumentsWithWrongNamedArgumentNames ( )

Twig_Error_Syntax Unknown arguments "unknown1", "unknown2" for function "date(format, timestamp)".

Definition at line 54 of file CallTest.php.

References array.

55  {
56  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'date'));
57  $node->getArguments('date', array('Y-m-d', 'timestamp' => null, 'unknown1' => '', 'unknown2' => ''));
58  }
Create styles array
The data for the language used.

◆ testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction()

Twig_Tests_Node_Expression_CallTest::testResolveArgumentsOnlyNecessaryArgumentsForCustomFunction ( )

Definition at line 70 of file CallTest.php.

References array.

71  {
72  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'custom_function'));
73 
74  $this->assertEquals(array('arg1'), $node->getArguments(array($this, 'customFunction'), array('arg1' => 'arg1')));
75  }
Create styles array
The data for the language used.

◆ testResolveArgumentsWithMissingParameterForArbitraryArguments()

Twig_Tests_Node_Expression_CallTest::testResolveArgumentsWithMissingParameterForArbitraryArguments ( )

LogicException The last parameter of "Twig_Tests_Node_Expression_CallTest::customFunctionWithArbitraryArguments" for function "foo" must be an array with default value, eg.

"array $arg = array()".

Definition at line 87 of file CallTest.php.

References array.

88  {
89  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'foo', 'is_variadic' => true));
90  $node->getArguments(array($this, 'customFunctionWithArbitraryArguments'), array());
91  }
Create styles array
The data for the language used.

◆ testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction()

Twig_Tests_Node_Expression_CallTest::testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnFunction ( )

LogicException #^The last parameter of "custom_Twig_Tests_Node_Expression_CallTest_function" for function "foo" must be an array with default value, eg.

"array \$arg \= array\(\)".$#

Definition at line 109 of file CallTest.php.

References array.

110  {
111  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'foo', 'is_variadic' => true));
112  $node->getArguments('custom_Twig_Tests_Node_Expression_CallTest_function', array());
113  }
Create styles array
The data for the language used.

◆ testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject()

Twig_Tests_Node_Expression_CallTest::testResolveArgumentsWithMissingParameterForArbitraryArgumentsOnObject ( )

LogicException #^The last parameter of "CallableTestClass\:\:__invoke" for function "foo" must be an array with default value, eg.

"array \$arg \= array\(\)".$#

Definition at line 119 of file CallTest.php.

References array.

120  {
121  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'foo', 'is_variadic' => true));
122  $node->getArguments(new CallableTestClass(), array());
123  }
Create styles array
The data for the language used.

◆ testResolveArgumentsWithMissingValueForOptionalArgument()

Twig_Tests_Node_Expression_CallTest::testResolveArgumentsWithMissingValueForOptionalArgument ( )

Twig_Error_Syntax Argument "case_sensitivity" could not be assigned for function "substr_compare(main_str, str, offset, length, case_sensitivity)" because it is mapped to an internal PHP function which cannot determine default value for optional argument "length".

Definition at line 64 of file CallTest.php.

References array.

65  {
66  $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'substr_compare'));
67  $node->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true));
68  }
Create styles array
The data for the language used.

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