ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CustomExtensionTest Class Reference
+ Inheritance diagram for CustomExtensionTest:
+ Collaboration diagram for CustomExtensionTest:

Public Member Functions

 testGetInvalidOperators (Twig_ExtensionInterface $extension, $expectedExceptionMessage)
 PHP 5.3 provideInvalidExtensions More...
 
 provideInvalidExtensions ()
 

Detailed Description

Definition at line 12 of file CustomExtensionTest.php.

Member Function Documentation

◆ provideInvalidExtensions()

CustomExtensionTest::provideInvalidExtensions ( )

Definition at line 32 of file CustomExtensionTest.php.

33  {
34  return array(
35  array(new InvalidOperatorExtension(new stdClass()), '"InvalidOperatorExtension::getOperators()" must return an array with operators, got "stdClass".'),
36  array(new InvalidOperatorExtension(array(1, 2, 3)), '"InvalidOperatorExtension::getOperators()" must return an array of 2 elements, got 3.'),
37  );
38  }

◆ testGetInvalidOperators()

CustomExtensionTest::testGetInvalidOperators ( Twig_ExtensionInterface  $extension,
  $expectedExceptionMessage 
)

PHP 5.3 provideInvalidExtensions

Definition at line 18 of file CustomExtensionTest.php.

References $env.

19  {
20  if (method_exists($this, 'expectException')) {
21  $this->expectException('InvalidArgumentException');
22  $this->expectExceptionMessage($expectedExceptionMessage);
23  } else {
24  $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
25  }
26 
27  $env = new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
28  $env->addExtension($extension);
29  $env->getUnaryOperators();
30  }
$env
Stores the Twig configuration.
Definition: Environment.php:17

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