Code Duplication    Length = 16-17 lines in 2 locations

tests/unit/Modify/ReFormatTest.php 2 locations

@@ 60-76 (lines=17) @@
57
        static::assertInstanceOf(FileModifierInterface::class, $this->reFormatter);
58
    }
59
60
    public function testCanModifyAcceptsFileNodeInterfaceWithAFormat()
61
    {
62
        $file = m::mock(FileNodeInterface::class, FormatAwareInterface::class);
63
        $file->shouldReceive('exists')
64
             ->andReturn(true);
65
66
        $format = m::mock(FormatInterface::class);
67
        $parser = m::mock(ParserInterface::class);
68
        $this->parserFactory->shouldReceive('getParser')
69
                            ->with($format)
70
                            ->andReturn($parser);
71
72
        $file->shouldReceive('getFormat')
73
             ->andReturn($format);
74
75
        static::assertTrue($this->reFormatter->canModify($file));
76
    }
77
78
    public function testCanModifyDoesNotAcceptAFormatThatCanNotBeParsed()
79
    {
@@ 78-93 (lines=16) @@
75
        static::assertTrue($this->reFormatter->canModify($file));
76
    }
77
78
    public function testCanModifyDoesNotAcceptAFormatThatCanNotBeParsed()
79
    {
80
        $file = m::mock(FileNodeInterface::class, FormatAwareInterface::class);
81
        $file->shouldReceive('exists')
82
             ->andReturn(true);
83
84
        $format = m::mock(FormatInterface::class);
85
        $this->parserFactory->shouldReceive('getParser')
86
                            ->with($format)
87
                            ->andReturn(null);
88
89
        $file->shouldReceive('getFormat')
90
             ->andReturn($format);
91
92
        static::assertFalse($this->reFormatter->canModify($file));
93
    }
94
95
    public function testCanReFormatWithANonLocalInputFileAndOutputFormat()
96
    {