@@ 19-27 (lines=9) @@ | ||
16 | $stream->goNext(); |
|
17 | } |
|
18 | ||
19 | public function testValid() |
|
20 | { |
|
21 | $valid = (bool) rand(0, 1); |
|
22 | $prophecy = $this->prophesize(\SplFileObject::class); |
|
23 | $prophecy->valid()->shouldBeCalledTimes(1)->willReturn($valid); |
|
24 | ||
25 | $stream = new FileStream($prophecy->reveal()); |
|
26 | $this->assertSame($valid, $stream->isValid()); |
|
27 | } |
|
28 | ||
29 | public function testGetLine() |
|
30 | { |
|
@@ 29-37 (lines=9) @@ | ||
26 | $this->assertSame($valid, $stream->isValid()); |
|
27 | } |
|
28 | ||
29 | public function testGetLine() |
|
30 | { |
|
31 | $line = 'https://foo.bar/baz'; |
|
32 | $prophecy = $this->prophesize(\SplFileObject::class); |
|
33 | $prophecy->current()->shouldBeCalled()->willReturn($line); |
|
34 | ||
35 | $stream = new FileStream($prophecy->reveal()); |
|
36 | $this->assertSame($line, $stream->getLine()); |
|
37 | } |
|
38 | } |
|
39 |