tests/unit/IO/FileReaderTest.php 1 location
|
@@ 94-105 (lines=12) @@
|
| 91 |
|
} |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
public function testNodeWithNoFormatAndNoFormatSpecifiedWillThrowAnException() |
| 95 |
|
{ |
| 96 |
|
$stream = fopen('php://memory', 'r'); |
| 97 |
|
|
| 98 |
|
$file = m::mock(FileNodeInterface::class, NodeStreamInterface::class); |
| 99 |
|
$file->shouldReceive('getStream') |
| 100 |
|
->with('r') |
| 101 |
|
->andReturn($stream); |
| 102 |
|
|
| 103 |
|
static::expectException(InvalidArgumentException::class); |
| 104 |
|
new FileReader($file); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
public function testNodeWithFormatWillUseThatFormat() |
| 108 |
|
{ |
tests/unit/IO/FileWriterTest.php 1 location
|
@@ 56-67 (lines=12) @@
|
| 53 |
|
new FileWriter($file); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
public function testNodeWithNoFormatAndNoFormatSpecifiedWillThrowAnException() |
| 57 |
|
{ |
| 58 |
|
$stream = $this->getStream(); |
| 59 |
|
|
| 60 |
|
$file = m::mock(FileNodeInterface::class, NodeStreamInterface::class); |
| 61 |
|
$file->shouldReceive('getStream') |
| 62 |
|
->with('c+b') |
| 63 |
|
->andReturn($stream); |
| 64 |
|
|
| 65 |
|
static::expectException(InvalidArgumentException::class); |
| 66 |
|
new FileWriter($file); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
public function testNodeWithFormatWillUseThatFormat() |
| 70 |
|
{ |