@@ 126-137 (lines=12) @@ | ||
123 | static::assertInstanceOf(ReaderInterface::class, $reader); |
|
124 | } |
|
125 | ||
126 | public function testProvidingAParserFactoryWillUseTheFactory() |
|
127 | { |
|
128 | $stream = fopen('php://memory', 'r'); |
|
129 | $iterator = m::mock(Iterator::class); |
|
130 | $parser = m::mock(ParserInterface::class); |
|
131 | $parser->shouldReceive('parse') |
|
132 | ->andReturn($iterator); |
|
133 | ||
134 | $reader = $this->buildFactoryReader($stream, $parser); |
|
135 | ||
136 | static::assertInstanceOf(ReaderInterface::class, $reader); |
|
137 | } |
|
138 | ||
139 | public function testFetch() |
|
140 | { |
@@ 31-46 (lines=16) @@ | ||
28 | ||
29 | class FileWriterTest extends TestCase |
|
30 | { |
|
31 | public function testNodeStreamFileWillGetAStream() |
|
32 | { |
|
33 | $stream = $this->getStream(); |
|
34 | ||
35 | $file = m::mock(FileNodeInterface::class, NodeStreamInterface::class); |
|
36 | $file->shouldReceive('getStream') |
|
37 | ->with('c+b') |
|
38 | ->andReturn($stream); |
|
39 | ||
40 | $format = m::mock(CsvFormat::class) |
|
41 | ->makePartial(); |
|
42 | ||
43 | $writer = new FileWriter($file, $format); |
|
44 | ||
45 | static::assertInstanceOf(WriterInterface::class, $writer); |
|
46 | } |
|
47 | ||
48 | public function testFileNodeWillThrowAnException() |
|
49 | { |