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

Public Member Functions

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

Detailed Description

Class .

Test suite of the counter iterator.

Definition at line 50 of file Counter.php.

Member Function Documentation

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

Definition at line 52 of file Counter.php.

53  {
54  $this
55  ->given($iterator = new LUT\Counter(0, 12, 3))
56  ->when($result = iterator_to_array($iterator))
57  ->then
58  ->array($result)
59  ->isEqualTo([0, 3, 6, 9]);
60  }
Hoa\Iterator\Test\Unit\Counter::case_offset ( )

Definition at line 62 of file Counter.php.

63  {
64  $this
65  ->given($iterator = new LUT\Counter(6, 12, 3))
66  ->when($result = iterator_to_array($iterator))
67  ->then
68  ->array($result)
69  ->isEqualTo([6, 9]);
70  }
Hoa\Iterator\Test\Unit\Counter::case_too_big ( )

Definition at line 81 of file Counter.php.

82  {
83  $this
84  ->given($iterator = new LUT\Counter(0, 12, 13))
85  ->when($result = iterator_to_array($iterator))
86  ->then
87  ->array($result)
88  ->isEqualTo([0]);
89  }
Hoa\Iterator\Test\Unit\Counter::case_too_small ( )

Definition at line 72 of file Counter.php.

73  {
74  $this
75  ->exception(function () {
76  new LUT\Counter(0, 0, 0);
77  })
78  ->isInstanceOf('Hoa\Iterator\Exception');
79  }

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