|
@@ 53-73 (lines=21) @@
|
| 50 |
|
static::assertTrue($this->merge->canContract($collection, $node)); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function testCanContractOnlyAcceptsLocalFiles() |
| 54 |
|
{ |
| 55 |
|
$collection = new FileNodeCollection(); |
| 56 |
|
$file1 = m::mock(LocalFile::class); |
| 57 |
|
$file1->shouldReceive('exists') |
| 58 |
|
->andReturn(true); |
| 59 |
|
$file1->shouldReceive('getCompression') |
| 60 |
|
->andReturn(CompressionType::NONE); |
| 61 |
|
$collection->add($file1); |
| 62 |
|
|
| 63 |
|
$out = m::mock(LocalFile::class); |
| 64 |
|
|
| 65 |
|
static::assertTrue($this->merge->canContract($collection, $out)); |
| 66 |
|
|
| 67 |
|
$file2 = m::mock(FileNodeInterface::class); |
| 68 |
|
$file2->shouldReceive('getCompression') |
| 69 |
|
->andReturn(CompressionType::NONE); |
| 70 |
|
$collection->add($file2); |
| 71 |
|
|
| 72 |
|
static::assertFalse($this->merge->canContract($collection, $out)); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
public function testCanContractOnlyWithFilesThatExist() |
| 76 |
|
{ |
|
@@ 75-97 (lines=23) @@
|
| 72 |
|
static::assertFalse($this->merge->canContract($collection, $out)); |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
public function testCanContractOnlyWithFilesThatExist() |
| 76 |
|
{ |
| 77 |
|
$collection = new FileNodeCollection(); |
| 78 |
|
$file1 = m::mock(LocalFile::class); |
| 79 |
|
$file1->shouldReceive('exists') |
| 80 |
|
->andReturn(true); |
| 81 |
|
$file1->shouldReceive('getCompression') |
| 82 |
|
->andReturn(CompressionType::NONE); |
| 83 |
|
$collection->add($file1); |
| 84 |
|
|
| 85 |
|
$out = m::mock(LocalFile::class); |
| 86 |
|
|
| 87 |
|
static::assertTrue($this->merge->canContract($collection, $out)); |
| 88 |
|
|
| 89 |
|
$file2 = m::mock(LocalFile::class); |
| 90 |
|
$file2->shouldReceive('exists') |
| 91 |
|
->andReturn(false); |
| 92 |
|
$file2->shouldReceive('getCompression') |
| 93 |
|
->andReturn(CompressionType::NONE); |
| 94 |
|
$collection->add($file2); |
| 95 |
|
|
| 96 |
|
static::assertFalse($this->merge->canContract($collection, $out)); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
public function testCanContractOnlyUncompressedFiles() |
| 100 |
|
{ |
|
@@ 99-121 (lines=23) @@
|
| 96 |
|
static::assertFalse($this->merge->canContract($collection, $out)); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
public function testCanContractOnlyUncompressedFiles() |
| 100 |
|
{ |
| 101 |
|
$collection = new FileNodeCollection(); |
| 102 |
|
$file1 = m::mock(LocalFile::class); |
| 103 |
|
$file1->shouldReceive('exists') |
| 104 |
|
->andReturn(true); |
| 105 |
|
$file1->shouldReceive('getCompression') |
| 106 |
|
->andReturn(CompressionType::NONE); |
| 107 |
|
$collection->add($file1); |
| 108 |
|
|
| 109 |
|
$out = m::mock(LocalFile::class); |
| 110 |
|
|
| 111 |
|
static::assertTrue($this->merge->canContract($collection, $out)); |
| 112 |
|
|
| 113 |
|
$file2 = m::mock(LocalFile::class); |
| 114 |
|
$file2->shouldReceive('exists') |
| 115 |
|
->andReturn(true); |
| 116 |
|
$file2->shouldReceive('getCompression') |
| 117 |
|
->andReturn(CompressionType::GZIP); |
| 118 |
|
$collection->add($file2); |
| 119 |
|
|
| 120 |
|
static::assertFalse($this->merge->canContract($collection, $out)); |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
public function testCallingCanContractWithANonLocalTargetWillThrowAnException() |
| 124 |
|
{ |