Skip to content

Tests: minor stability tweak #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/Core/AbstractMethodUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ abstract class AbstractMethodUnitTest extends TestCase
*/
public static function initializeFile()
{
$config = new ConfigDouble();
$_SERVER['argv'] = [];
$config = new ConfigDouble();
// Also set a tab-width to enable testing tab-replaced vs `orig_content`.
$config->tabWidth = static::$tabWidth;

Expand Down
6 changes: 4 additions & 2 deletions tests/Core/Tokenizer/AbstractTokenizerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ abstract class AbstractTokenizerTestCase extends TestCase
protected function initializeFile()
{
if (isset($this->phpcsFile) === false) {
$config = new ConfigDouble();
$_SERVER['argv'] = [];
$config = new ConfigDouble();

// Also set a tab-width to enable testing tab-replaced vs `orig_content`.
$config->tabWidth = $this->tabWidth;

Expand All @@ -79,7 +81,7 @@ protected function initializeFile()

$this->phpcsFile = new DummyFile($contents, $ruleset, $config);
$this->phpcsFile->parse();
}
}//end if

}//end initializeFile()

Expand Down