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

Public Member Functions

 testReprNumericValueWithLocale ()
 

Detailed Description

Definition at line 12 of file CompilerTest.php.

Member Function Documentation

◆ testReprNumericValueWithLocale()

Twig_Tests_CompilerTest::testReprNumericValueWithLocale ( )

Definition at line 14 of file CompilerTest.php.

15  {
16  $compiler = new Twig_Compiler(new Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
17 
18  $locale = setlocale(LC_NUMERIC, 0);
19  if (false === $locale) {
20  $this->markTestSkipped('Your platform does not support locales.');
21  }
22 
23  $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252');
24  if (false === setlocale(LC_NUMERIC, $required_locales)) {
25  $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales));
26  }
27 
28  $this->assertEquals('1.2', $compiler->repr(1.2)->getSource());
29  $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0)));
30 
31  setlocale(LC_NUMERIC, $locale);
32  }
Stores the Twig configuration.
Definition: Environment.php:17

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