1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Prevent tests from producing output (#3847)

* Prevent tests from producing output

- These are considered risky by PHPUnit
- And they mess up PHPUnit output

* Import used functions
This commit is contained in:
Bruce Weirdan 2020-07-20 11:52:01 +03:00 committed by GitHub
parent 5212bd1f9c
commit b23deaad01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,8 @@ use Psalm\PluginRegistrationSocket;
use Psalm\Tests\Internal\Provider;
use Psalm\Tests\TestConfig;
use function sprintf;
use function ob_start;
use function ob_end_clean;
class PluginTest extends \Psalm\Tests\TestCase
{
@ -869,7 +871,9 @@ class PluginTest extends \Psalm\Tests\TestCase
$this->project_analyzer->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
ob_start();
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
ob_end_clean();
}
/**

View File

@ -173,7 +173,9 @@ class ProjectCheckerTest extends TestCase
$this->project_analyzer->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
ob_start();
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
ob_end_clean();
$this->assertSame(
'Psalm was able to infer types for 100% of the codebase',
@ -218,7 +220,9 @@ class ProjectCheckerTest extends TestCase
$this->project_analyzer->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
ob_start();
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
ob_end_clean();
$this->assertSame(
'Psalm was able to infer types for 100% of the codebase',