Skip to content

Commit c8d68d6

Browse files
committed
Tests/HeredocNowdocCloserTest: remove overloaded "setUpBeforeClass" method
Follow up on 220 / commit 5aa4362 . As the `tabWidth` setting is now available via the `AbstractMethodUnitTest`, the `initializeFile()` method no longer needs to be overloaded for this test.
1 parent 5bd0b83 commit c8d68d6

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

tests/Core/Tokenizer/HeredocNowdocCloserTest.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
namespace PHP_CodeSniffer\Tests\Core\Tokenizer;
1111

12-
use PHP_CodeSniffer\Config;
13-
use PHP_CodeSniffer\Ruleset;
14-
use PHP_CodeSniffer\Files\DummyFile;
1512
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
1613

1714
/**
@@ -23,39 +20,6 @@ final class HeredocNowdocCloserTest extends AbstractMethodUnitTest
2320
{
2421

2522

26-
/**
27-
* Initialize & tokenize \PHP_CodeSniffer\Files\File with code from the test case file.
28-
*
29-
* {@internal This is a near duplicate of the original method. Only difference is that
30-
* tab replacement is enabled for this test.}
31-
*
32-
* @beforeClass
33-
*
34-
* @return void
35-
*/
36-
public static function initializeFile()
37-
{
38-
$config = new Config();
39-
$config->standards = ['PSR1'];
40-
$config->tabWidth = 4;
41-
42-
$ruleset = new Ruleset($config);
43-
44-
// Default to a file with the same name as the test class. Extension is property based.
45-
$relativeCN = str_replace(__NAMESPACE__, '', get_called_class());
46-
$relativePath = str_replace('\\', DIRECTORY_SEPARATOR, $relativeCN);
47-
$pathToTestFile = realpath(__DIR__).$relativePath.'.'.static::$fileExtension;
48-
49-
// Make sure the file gets parsed correctly based on the file type.
50-
$contents = 'phpcs_input_file: '.$pathToTestFile.PHP_EOL;
51-
$contents .= file_get_contents($pathToTestFile);
52-
53-
self::$phpcsFile = new DummyFile($contents, $ruleset, $config);
54-
self::$phpcsFile->process();
55-
56-
}//end initializeFile()
57-
58-
5923
/**
6024
* Verify that leading (indent) whitespace in a heredoc/nowdoc closer token get the tab replacement treatment.
6125
*

0 commit comments

Comments
 (0)