Code Duplication    Length = 10-10 lines in 2 locations

test/StdRangesCalculatorTest.php 2 locations

@@ 195-204 (lines=10) @@
192
        $this->assertEquals('2018-02-10 00:01:00', $ranges[2]->dateTo()->format('Y-m-d H:i:s'));
193
    }
194
195
    public function test_subLeftSide(): void
196
    {
197
        $range1 = new Range(new \DateTime('2018-01-01 00:01:00'), new \DateTime('2018-01-04 00:02:00'));
198
        $range2 = new Range(new \DateTime('2017-12-30 00:00:00'), new \DateTime('2018-01-03 00:02:00'));
199
200
        $ranges = $this->calculator->sub($range1, $range2);
201
        $this->assertCount(1, $ranges);
202
        $this->assertEquals('2018-01-03 00:02:01', $ranges[0]->dateFrom()->format('Y-m-d H:i:s'));
203
        $this->assertEquals('2018-01-04 00:02:00', $ranges[0]->dateTo()->format('Y-m-d H:i:s'));
204
    }
205
206
    public function test_subRightSide(): void
207
    {
@@ 206-215 (lines=10) @@
203
        $this->assertEquals('2018-01-04 00:02:00', $ranges[0]->dateTo()->format('Y-m-d H:i:s'));
204
    }
205
206
    public function test_subRightSide(): void
207
    {
208
        $range1 = new Range(new \DateTime('2018-01-01 00:01:00'), new \DateTime('2018-01-04 00:02:00'));
209
        $range2 = new Range(new \DateTime('2018-01-02 00:00:00'), new \DateTime('2018-03-01 00:02:00'));
210
211
        $ranges = $this->calculator->sub($range1, $range2);
212
        $this->assertCount(1, $ranges);
213
        $this->assertEquals('2018-01-01 00:01:00', $ranges[0]->dateFrom()->format('Y-m-d H:i:s'));
214
        $this->assertEquals('2018-01-01 23:59:59', $ranges[0]->dateTo()->format('Y-m-d H:i:s'));
215
    }
216
217
    public function test_subMix(): void
218
    {