Code Duplication    Length = 19-21 lines in 3 locations

tests/integration/Modify/Contract/MergeFilesTest.php 3 locations

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