|
@@ 123-138 (lines=16) @@
|
| 120 |
|
static::assertFalse($this->merge->canContract($collection, $out)); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
public function testCallingContractWithAFileThatCannotBeContractedWillThrowAnException() |
| 124 |
|
{ |
| 125 |
|
$collection = new FileNodeCollection(); |
| 126 |
|
$file = m::mock(LocalFile::class); |
| 127 |
|
$file->shouldReceive('exists') |
| 128 |
|
->andReturn(false); |
| 129 |
|
$file->shouldReceive('getCompression') |
| 130 |
|
->andReturn(CompressionType::NONE); |
| 131 |
|
$collection->add($file); |
| 132 |
|
|
| 133 |
|
$target = m::mock(LocalFile::class); |
| 134 |
|
|
| 135 |
|
$this->expectException(InvalidArgumentException::class); |
| 136 |
|
|
| 137 |
|
$this->merge->contract($collection, $target); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
public function testCallingContractWithANonLocalTargetWillThrowAnException() |
| 141 |
|
{ |
|
@@ 140-157 (lines=18) @@
|
| 137 |
|
$this->merge->contract($collection, $target); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
public function testCallingContractWithANonLocalTargetWillThrowAnException() |
| 141 |
|
{ |
| 142 |
|
$collection = new FileNodeCollection(); |
| 143 |
|
$file = m::mock(LocalFile::class); |
| 144 |
|
$file->shouldReceive('exists') |
| 145 |
|
->andReturn(true); |
| 146 |
|
$file->shouldReceive('getCompression') |
| 147 |
|
->andReturn(CompressionType::NONE); |
| 148 |
|
$collection->add($file); |
| 149 |
|
|
| 150 |
|
$target = m::mock(FileNodeInterface::class); |
| 151 |
|
|
| 152 |
|
static::assertFalse($this->merge->canContract($collection, $target)); |
| 153 |
|
|
| 154 |
|
$this->expectException(InvalidArgumentException::class); |
| 155 |
|
|
| 156 |
|
$this->merge->contract($collection, $target); |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
public function testSimpleMergeFiles() |
| 160 |
|
{ |