| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class IterableToArrayTest extends TestCase |
||
| 12 | { |
||
| 13 | use ProvideIterablesTrait; |
||
| 14 | |||
| 15 | public function provider() |
||
| 16 | { |
||
| 17 | return $this->provideIterables(['I' => 'one', 'II' => 'two', 'III' => 'three']); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @dataProvider provider |
||
| 22 | */ |
||
| 23 | public function test($values, $expected) |
||
| 24 | { |
||
| 25 | $result = iterable_to_array($values); |
||
| 26 | |||
| 27 | $this->assertSame($expected, $result); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function testEmpty() |
||
| 31 | { |
||
| 32 | $result = iterable_to_array(new \EmptyIterator()); |
||
| 33 | |||
| 34 | $this->assertEquals([], $result); |
||
| 35 | } |
||
| 37 |