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

Public Member Functions

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

Detailed Description

Class .

Test suite of the mock iterator.

Definition at line 50 of file Mock.php.

Member Function Documentation

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

Definition at line 52 of file Mock.php.

53  {
54  $this
55  ->given($iterator = new LUT\Mock())
56  ->when($result = iterator_to_array($iterator))
57  ->then
58  ->array($result)
59  ->isEmpty();
60  }
Hoa\Iterator\Test\Unit\Mock::case_recursive ( )

Definition at line 73 of file Mock.php.

74  {
75  $this
76  ->given(
77  $map = new LUT\Map(['a', 'b', 'c']),
78  $mock = new LUT\Recursive\Mock($map),
79  $iteratoriterator = new LUT\Recursive\Iterator($mock)
80  )
81  ->when($result = iterator_to_array($map, false))
82  ->then
83  ->array($result)
84  ->isEqualTo(['a', 'b', 'c']);
85  }
Hoa\Iterator\Test\Unit\Mock::case_recursive_mock_mock ( )

Definition at line 62 of file Mock.php.

63  {
64  $this
65  ->when($iterator = new LUT\Recursive\Mock(new LUT\Mock()))
66  ->then
67  ->variable($iterator->getChildren())
68  ->isNull()
69  ->boolean($iterator->hasChildren())
70  ->isFalse();
71  }

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