15
15
/**
16
16
* Tests for the \PHPCSUtils\TestUtils\UtilityMethodTestCase class.
17
17
*
18
- * @covers \PHPCSUtils\TestUtils\UtilityMethodTestCase
18
+ * @covers \PHPCSUtils\TestUtils\UtilityMethodTestCase::setUpTestFile
19
+ * @covers \PHPCSUtils\TestUtils\UtilityMethodTestCase::parseFile
20
+ * @covers \PHPCSUtils\TestUtils\UtilityMethodTestCase::skipJSCSSTestsOnPHPCS4
19
21
*
20
22
* @since 1.0.0
21
23
*/
22
- final class UtilityMethodTestCaseTest extends PolyfilledTestCase
24
+ final class SetUpTestFileTest extends PolyfilledTestCase
23
25
{
24
26
25
27
/**
@@ -32,7 +34,7 @@ final class UtilityMethodTestCaseTest extends PolyfilledTestCase
32
34
*/
33
35
public static function setUpTestFile ()
34
36
{
35
- // Deliberately left empty .
37
+ // Deliberately not running the actual setUpTestFile() method .
36
38
}
37
39
38
40
/**
@@ -42,29 +44,24 @@ public static function setUpTestFile()
42
44
*/
43
45
public function testSetUp ()
44
46
{
47
+ // Verify that the class was virgin to begin with.
48
+ $ this ->assertSame ('0 ' , self ::$ phpcsVersion , 'phpcsVersion was not correct to begin with ' );
49
+ $ this ->assertSame ('inc ' , self ::$ fileExtension , 'fileExtension was not correct to begin with ' );
50
+ $ this ->assertSame ('' , self ::$ caseFile , 'caseFile was not correct to begin with ' );
51
+ $ this ->assertSame (4 , self ::$ tabWidth , 'tabWidth was not correct to begin with ' );
52
+ $ this ->assertNull (self ::$ phpcsFile , 'phpcsFile was not correct to begin with ' );
53
+ $ this ->assertSame (['Dummy.Dummy.Dummy ' ], self ::$ selectedSniff , 'selectedSniff was not correct to begin with ' );
54
+
55
+ // Run the set up.
45
56
parent ::setUpTestFile ();
57
+
58
+ // Verify select properties have been set correctly.
59
+ $ this ->assertNotSame ('0 ' , self ::$ phpcsVersion , 'phpcsVersion was not set ' );
60
+
46
61
$ this ->assertInstanceOf ('PHP_CodeSniffer\Files\File ' , self ::$ phpcsFile );
47
62
$ this ->assertSame (57 , self ::$ phpcsFile ->numTokens );
48
63
49
64
$ tokens = self ::$ phpcsFile ->getTokens ();
50
65
$ this ->assertIsArray ($ tokens );
51
66
}
52
-
53
- /**
54
- * Test that the class is correct reset.
55
- *
56
- * @depends testSetUp
57
- *
58
- * @return void
59
- */
60
- public function testTearDown ()
61
- {
62
- parent ::resetTestFile ();
63
- $ this ->assertSame ('0 ' , self ::$ phpcsVersion , 'phpcsVersion was not reset ' );
64
- $ this ->assertSame ('inc ' , self ::$ fileExtension , 'fileExtension was not reset ' );
65
- $ this ->assertSame ('' , self ::$ caseFile , 'caseFile was not reset ' );
66
- $ this ->assertSame (4 , self ::$ tabWidth , 'tabWidth was not reset ' );
67
- $ this ->assertNull (self ::$ phpcsFile , 'phpcsFile was not reset ' );
68
- $ this ->assertSame (['Dummy.Dummy.Dummy ' ], self ::$ selectedSniff , 'selectedSniff was not reset ' );
69
- }
70
67
}
0 commit comments