Hoa central
Public Member Functions | List of all members
Hoa\Iterator\Test\Unit\Multiple Class Reference
Inheritance diagram for Hoa\Iterator\Test\Unit\Multiple:

Public Member Functions

 case_classic ()
 
 case_default_value ()
 
 case_empty ()
 
- Public Member Functions inherited from Hoa\Test\Unit\Suite
 __construct ()
 
 getTestedClassName ()
 
 getTestedClassNamespace ()
 
 beforeTestMethod ($methodName)
 

Detailed Description

Class .

Test suite of the multiple iterator.

Definition at line 50 of file Multiple.php.

Member Function Documentation

Hoa\Iterator\Test\Unit\Multiple::case_classic ( )

Definition at line 52 of file Multiple.php.

53  {
54  $this
55  ->given(
56  $foo = new LUT\Map(['f', 'o', 'o']),
57  $bar = new LUT\Map(['b', 'a', 'r']),
58  $multiple = new LUT\Multiple(
59  LUT\Multiple::MIT_NEED_ANY
60  | LUT\Multiple::MIT_KEYS_ASSOC
61  ),
62  $multiple->attachIterator($foo, 'one'),
63  $multiple->attachIterator($bar, 'two')
64  )
65  ->when($result = iterator_to_array($multiple, false))
66  ->then
67  ->array($result)
68  ->isEqualTo([
69  ['one' => 'f', 'two' => 'b'],
70  ['one' => 'o', 'two' => 'a'],
71  ['one' => 'o', 'two' => 'r']
72  ]);
73  }
Hoa\Iterator\Test\Unit\Multiple::case_default_value ( )

Definition at line 75 of file Multiple.php.

76  {
77  $this
78  ->given(
79  $foobar = new LUT\Map(['f', 'o', 'o', 'b', 'a', 'r']),
80  $baz = new LUT\Map(['b', 'a', 'z']),
81  $multiple = new LUT\Multiple(
82  LUT\Multiple::MIT_NEED_ANY
83  | LUT\Multiple::MIT_KEYS_ASSOC
84  ),
85  $multiple->attachIterator($foobar, 'one', '!'),
86  $multiple->attachIterator($baz, 'two', '?')
87  )
88  ->when($result = iterator_to_array($multiple, false))
89  ->then
90  ->array($result)
91  ->isEqualTo([
92  ['one' => 'f', 'two' => 'b'],
93  ['one' => 'o', 'two' => 'a'],
94  ['one' => 'o', 'two' => 'z'],
95  ['one' => 'b', 'two' => '?'],
96  ['one' => 'a', 'two' => '?'],
97  ['one' => 'r', 'two' => '?'],
98  ]);
99  }
Hoa\Iterator\Test\Unit\Multiple::case_empty ( )

Definition at line 101 of file Multiple.php.

102  {
103  $this
104  ->given($multiple = new LUT\Multiple())
105  ->when($result = iterator_to_array($multiple))
106  ->then
107  ->array($result)
108  ->isEmpty();
109  }

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