ArrayInputTest::testReset()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
rs 9.9332
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Maketok\DataMigration\Input;
4
5
class ArrayInputTest extends \PHPUnit_Framework_TestCase
6
{
7
    /** @var  ArrayInput */
8
    private $input;
9
10
    public function setUp()
11
    {
12
        $this->input = new ArrayInput();
13
    }
14
15
    public function testKey()
16
    {
17
        $this->assertSame(0, $this->input->key());
18
        $this->input->next();
19
        $this->assertSame(1, $this->input->key());
20
    }
21
22
    public function testValid()
23
    {
24
        $this->assertFalse($this->input->valid());
25
        $this->input->add(['1']);
26
        $this->assertTrue($this->input->valid());
27
    }
28
29
    public function testGet()
30
    {
31
        $this->input->add([1,2]);
32
        $this->input->add([2,3]);
33
34
        $this->assertSame([1,2], $this->input->get());
35
        $this->assertSame([2,3], $this->input->get());
36
        $this->assertSame(false, $this->input->get());
37
    }
38
39
    public function testReset()
40
    {
41
        $this->input->add([1,2]);
42
43
        $this->assertSame([1,2], $this->input->get());
44
        $this->assertSame(false, $this->input->get());
45
        $this->input->reset();
46
        $this->assertSame([1,2], $this->input->get());
47
        $this->assertSame(false, $this->input->get());
48
    }
49
}
50