Failed Conditions
Branch master (01ba0d)
by Arnold
06:58 queued 01:45
created

IterableToArrayTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 3
1
<?php
2
3
namespace Jasny\Tests;
4
5
use PHPUnit\Framework\TestCase;
6
use function Jasny\iterable_to_array;
7
8
/**
9
 * @covers \Jasny\iterable_to_array
10
 */
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
    }
36
}
37