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:
parent
5212bd1f9c
commit
b23deaad01
@ -22,6 +22,8 @@ use Psalm\PluginRegistrationSocket;
|
|||||||
use Psalm\Tests\Internal\Provider;
|
use Psalm\Tests\Internal\Provider;
|
||||||
use Psalm\Tests\TestConfig;
|
use Psalm\Tests\TestConfig;
|
||||||
use function sprintf;
|
use function sprintf;
|
||||||
|
use function ob_start;
|
||||||
|
use function ob_end_clean;
|
||||||
|
|
||||||
class PluginTest extends \Psalm\Tests\TestCase
|
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->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
|
||||||
|
|
||||||
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
|
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
|
||||||
|
ob_start();
|
||||||
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
|
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
|
||||||
|
ob_end_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -173,7 +173,9 @@ class ProjectCheckerTest extends TestCase
|
|||||||
$this->project_analyzer->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
|
$this->project_analyzer->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
|
||||||
|
|
||||||
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
|
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
|
||||||
|
ob_start();
|
||||||
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
|
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'Psalm was able to infer types for 100% of the codebase',
|
'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->stdout_report_options->format = \Psalm\Report::TYPE_JSON;
|
||||||
|
|
||||||
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
|
$this->project_analyzer->check('tests/fixtures/DummyProject', true);
|
||||||
|
ob_start();
|
||||||
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
|
\Psalm\IssueBuffer::finish($this->project_analyzer, true, microtime(true));
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'Psalm was able to infer types for 100% of the codebase',
|
'Psalm was able to infer types for 100% of the codebase',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user