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:
parent
af1155239e
commit
e32eb5c93f
@ -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' => [
|
||||
'<?php
|
||||
namespace A\B\C {
|
||||
|
Loading…
Reference in New Issue
Block a user