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

Public Member Functions

 testShuffleFilter ($data, $expectedElements)
 getShuffleFilterTestData More...
 
 testShuffleFilterOnEmptyArray ()
 
 getShuffleFilterTestData ()
 

Detailed Description

Definition at line 13 of file ArrayTest.php.

Member Function Documentation

◆ getShuffleFilterTestData()

Twig_Tests_Extension_ArrayTest::getShuffleFilterTestData ( )

Definition at line 30 of file ArrayTest.php.

31  {
32  return array(
33  array(
34  array(1, 2, 3),
35  array(1, 2, 3),
36  ),
37  array(
38  array('a' => 'apple', 'b' => 'orange', 'c' => 'citrus'),
39  array('apple', 'orange', 'citrus'),
40  ),
41  array(
42  new ArrayObject(array('apple', 'orange', 'citrus')),
43  array('apple', 'orange', 'citrus'),
44  ),
45  );
46  }

◆ testShuffleFilter()

Twig_Tests_Extension_ArrayTest::testShuffleFilter (   $data,
  $expectedElements 
)

getShuffleFilterTestData

Definition at line 18 of file ArrayTest.php.

References $data, and twig_shuffle_filter().

19  {
20  foreach ($expectedElements as $element) {
21  $this->assertTrue(in_array($element, twig_shuffle_filter($data), true)); // assertContains() would not consider the type
22  }
23  }
twig_shuffle_filter($array)
Shuffles an array.
Definition: Array.php:45
$data
Definition: bench.php:6
+ Here is the call graph for this function:

◆ testShuffleFilterOnEmptyArray()

Twig_Tests_Extension_ArrayTest::testShuffleFilterOnEmptyArray ( )

Definition at line 25 of file ArrayTest.php.

References twig_shuffle_filter().

26  {
27  $this->assertEquals(array(), twig_shuffle_filter(array()));
28  }
twig_shuffle_filter($array)
Shuffles an array.
Definition: Array.php:45
+ Here is the call graph for this function:

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