@@ 136-151 (lines=16) @@ | ||
133 | static::assertFalse($this->merge->canContract($collection, $out)); |
|
134 | } |
|
135 | ||
136 | public function testCallingContractWithAFileThatCannotBeContractedWillThrowAnException() |
|
137 | { |
|
138 | $collection = new FileNodeCollection(); |
|
139 | $file = m::mock(LocalFile::class); |
|
140 | $file->shouldReceive('exists') |
|
141 | ->andReturn(false); |
|
142 | $file->shouldReceive('getCompression') |
|
143 | ->andReturn(CompressionFactory::TYPE_NONE); |
|
144 | $collection->add($file); |
|
145 | ||
146 | $target = m::mock(LocalFile::class); |
|
147 | ||
148 | $this->expectException(InvalidArgumentException::class); |
|
149 | ||
150 | $this->merge->contract($collection, $target); |
|
151 | } |
|
152 | ||
153 | public function testCallingContractWithANonLocalTargetWillThrowAnException() |
|
154 | { |
|
@@ 153-170 (lines=18) @@ | ||
150 | $this->merge->contract($collection, $target); |
|
151 | } |
|
152 | ||
153 | public function testCallingContractWithANonLocalTargetWillThrowAnException() |
|
154 | { |
|
155 | $collection = new FileNodeCollection(); |
|
156 | $file = m::mock(LocalFile::class); |
|
157 | $file->shouldReceive('exists') |
|
158 | ->andReturn(true); |
|
159 | $file->shouldReceive('getCompression') |
|
160 | ->andReturn(CompressionFactory::TYPE_NONE); |
|
161 | $collection->add($file); |
|
162 | ||
163 | $target = m::mock(FileNodeInterface::class); |
|
164 | ||
165 | static::assertFalse($this->merge->canContract($collection, $target)); |
|
166 | ||
167 | $this->expectException(InvalidArgumentException::class); |
|
168 | ||
169 | $this->merge->contract($collection, $target); |
|
170 | } |
|
171 | ||
172 | public function testSimpleMergeFiles() |
|
173 | { |