From e32eb5c93f96aac1ad55f9d8b83959047937387e Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Sat, 17 Feb 2018 17:15:50 -0500 Subject: [PATCH] Speed up manipulation test by only turning on plugin once --- tests/FileManipulationTest.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/tests/FileManipulationTest.php b/tests/FileManipulationTest.php index fcc359618..5d490cfea 100644 --- a/tests/FileManipulationTest.php +++ b/tests/FileManipulationTest.php @@ -9,9 +9,6 @@ class FileManipulationTest extends TestCase /** @var \Psalm\Checker\ProjectChecker */ protected $project_checker; - /** @var TestConfig|null */ - private static $config; - /** * @return void */ @@ -21,17 +18,6 @@ class FileManipulationTest extends TestCase \Psalm\FileManipulation\FunctionDocblockManipulator::clearCache(); $this->file_provider = new Provider\FakeFileProvider(); - - if (!self::$config) { - self::$config = new TestConfig(); - self::$config->addPluginPath('examples/ClassUnqualifier.php'); - } - - $this->project_checker = new \Psalm\Checker\ProjectChecker( - self::$config, - $this->file_provider, - new Provider\FakeParserCacheProvider() - ); } /** @@ -58,6 +44,18 @@ class FileManipulationTest extends TestCase $this->markTestSkipped('Skipped due to a bug.'); } + $config = new TestConfig(); + + if (empty($issues_to_fix)) { + $config->addPluginPath('examples/ClassUnqualifier.php'); + } + + $this->project_checker = new \Psalm\Checker\ProjectChecker( + $config, + $this->file_provider, + new Provider\FakeParserCacheProvider() + ); + $context = new Context(); $file_path = self::$src_dir_path . 'somefile.php'; @@ -848,7 +846,6 @@ class FileManipulationTest extends TestCase ['PossiblyUndefinedGlobalVariable'], true, ], - 'useUnqualifierPlugin' => [ '