Code Duplication    Length = 21-21 lines in 2 locations

tests/Sniffs/ControlStructures/NewClass/NewClassSniffTest.php 1 location

@@ 12-32 (lines=21) @@
9
use ZenifyCodingStandard\Sniffs\ControlStructures\NewClassSniff;
10
11
12
final class NewClassSniffTest extends TestCase
13
{
14
15
	public function testDetection()
16
	{
17
		$codeSnifferRunner = new CodeSnifferRunner(NewClassSniff::NAME);
18
19
		$this->assertSame(1, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong.php'));
20
		$this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct.php'));
21
	}
22
23
24
	public function testFixing()
25
	{
26
		$codeSnifferRunner = new CodeSnifferRunner(NewClassSniff::NAME);
27
28
		$fixedContent = $codeSnifferRunner->getFixedContent(__DIR__ . '/wrong.php');
29
		$this->assertSame(file_get_contents(__DIR__ . '/wrong-fixed.php'), $fixedContent);
30
	}
31
32
}
33

tests/Sniffs/WhiteSpace/IfElseTryCatchFinally/IfElseTryCatchFinallySniffTest.php 1 location

@@ 12-32 (lines=21) @@
9
use ZenifyCodingStandard\Sniffs\WhiteSpace\IfElseTryCatchFinallySniff;
10
11
12
final class IfElseTryCatchFinallySniffTest extends TestCase
13
{
14
15
	public function testDetection()
16
	{
17
		$codeSnifferRunner = new CodeSnifferRunner(IfElseTryCatchFinallySniff::NAME);
18
19
		$this->assertSame(3, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/wrong.php'));
20
		$this->assertSame(0, $codeSnifferRunner->getErrorCountInFile(__DIR__ . '/correct.php'));
21
	}
22
23
24
	public function testFixing()
25
	{
26
		$codeSnifferRunner = new CodeSnifferRunner(IfElseTryCatchFinallySniff::NAME);
27
28
		$fixedContent = $codeSnifferRunner->getFixedContent(__DIR__ . '/wrong.php');
29
		$this->assertSame(file_get_contents(__DIR__ . '/wrong-fixed.php'), $fixedContent);
30
	}
31
32
}
33