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

Public Member Functions

 setUp ()
 
 testTruncate ($input, $length, $preserve, $separator, $expectedOutput)
 getTruncateTestData More...
 
 getTruncateTestData ()
 

Private Attributes

 $env
 

Detailed Description

Definition at line 14 of file TextTest.php.

Member Function Documentation

◆ getTruncateTestData()

Twig_Tests_Extension_TextTest::getTruncateTestData ( )

Definition at line 38 of file TextTest.php.

References array.

39  {
40  return array(
41  array('This is a very long sentence.', 2, false, '...', 'Th...'),
42  array('This is a very long sentence.', 6, false, '...', 'This i...'),
43  array('This is a very long sentence.', 2, true, '...', 'This...'),
44  array('This is a very long sentence.', 2, true, '[...]', 'This[...]'),
45  array('This is a very long sentence.', 23, false, '...', 'This is a very long sen...'),
46  array('This is a very long sentence.', 23, true, '...', 'This is a very long sentence.'),
47  );
48  }
Create styles array
The data for the language used.

◆ setUp()

Twig_Tests_Extension_TextTest::setUp ( )

Definition at line 19 of file TextTest.php.

20  {
21  $this->env = $this->getMockBuilder('Twig_Environment')->disableOriginalConstructor()->getMock();
22  $this->env
23  ->expects($this->any())
24  ->method('getCharset')
25  ->will($this->returnValue('utf-8'))
26  ;
27  }

◆ testTruncate()

Twig_Tests_Extension_TextTest::testTruncate (   $input,
  $length,
  $preserve,
  $separator,
  $expectedOutput 
)

getTruncateTestData

Definition at line 32 of file TextTest.php.

References $output.

33  {
34  $output = twig_truncate_filter($this->env, $input, $length, $preserve, $separator);
35  $this->assertEquals($expectedOutput, $output);
36  }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output

Field Documentation

◆ $env

Twig_Tests_Extension_TextTest::$env
private

Definition at line 17 of file TextTest.php.


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