1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Speed up manipulation test by only turning on plugin once

This commit is contained in:
Matthew Brown 2018-02-17 17:15:50 -05:00
parent af1155239e
commit e32eb5c93f

View File

@ -9,9 +9,6 @@ class FileManipulationTest extends TestCase
/** @var \Psalm\Checker\ProjectChecker */ /** @var \Psalm\Checker\ProjectChecker */
protected $project_checker; protected $project_checker;
/** @var TestConfig|null */
private static $config;
/** /**
* @return void * @return void
*/ */
@ -21,17 +18,6 @@ class FileManipulationTest extends TestCase
\Psalm\FileManipulation\FunctionDocblockManipulator::clearCache(); \Psalm\FileManipulation\FunctionDocblockManipulator::clearCache();
$this->file_provider = new Provider\FakeFileProvider(); $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.'); $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(); $context = new Context();
$file_path = self::$src_dir_path . 'somefile.php'; $file_path = self::$src_dir_path . 'somefile.php';
@ -848,7 +846,6 @@ class FileManipulationTest extends TestCase
['PossiblyUndefinedGlobalVariable'], ['PossiblyUndefinedGlobalVariable'],
true, true,
], ],
'useUnqualifierPlugin' => [ 'useUnqualifierPlugin' => [
'<?php '<?php
namespace A\B\C { namespace A\B\C {