You are here

public function Twig_Tests_Node_Expression_CallTest::testResolveArgumentsWithMissingValueForOptionalArgument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php \Twig_Tests_Node_Expression_CallTest::testResolveArgumentsWithMissingValueForOptionalArgument()

@expectedException Twig_Error_Syntax @expectedExceptionMessage 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".

File

vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php, line 64

Class

Twig_Tests_Node_Expression_CallTest

Code

public function testResolveArgumentsWithMissingValueForOptionalArgument() {
  if (defined('HHVM_VERSION')) {
    $this
      ->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)');
  }
  $node = new Twig_Tests_Node_Expression_Call(array(), array(
    'type' => 'function',
    'name' => 'substr_compare',
  ));
  $node
    ->getArguments('substr_compare', array(
    'abcd',
    'bc',
    'offset' => 1,
    'case_sensitivity' => true,
  ));
}