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

Fix falsable issues with ob_get_clean in tests

This commit is contained in:
robchett 2023-10-09 21:44:31 +01:00
parent 5e667ef35d
commit 70507717c4
2 changed files with 6 additions and 6 deletions

View File

@ -126,7 +126,7 @@ class IssueBufferTest extends TestCase
ob_start();
IssueBuffer::finish($projectAnalzyer, false, microtime(true), false, $baseline);
$output = ob_get_clean();
$output = (string) ob_get_clean();
$this->assertStringNotContainsString("ERROR", $output, "all issues baselined");
IssueBuffer::clear();
}
@ -137,7 +137,7 @@ class IssueBufferTest extends TestCase
$project_analyzer->stdout_report_options = new ReportOptions;
ob_start();
IssueBuffer::printSuccessMessage($project_analyzer);
$output = ob_get_clean();
$output = (string) ob_get_clean();
$this->assertStringContainsString('No errors found!', $output);
}

View File

@ -93,7 +93,7 @@ class ProjectCheckerTest extends TestCase
ob_start();
$this->project_analyzer->check('tests/fixtures/DummyProject');
$output = ob_get_clean();
$output = (string) ob_get_clean();
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
@ -280,7 +280,7 @@ class Bat
ob_start();
$this->project_analyzer->checkDir('tests/fixtures/DummyProject');
$output = ob_get_clean();
$output = (string) ob_get_clean();
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
@ -321,7 +321,7 @@ class Bat
realpath((string) getcwd() . '/tests/fixtures/DummyProject/Bar.php'),
realpath((string) getcwd() . '/tests/fixtures/DummyProject/SomeTrait.php'),
]);
$output = ob_get_clean();
$output = (string) ob_get_clean();
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
@ -362,7 +362,7 @@ class Bat
realpath((string) getcwd() . '/tests/fixtures/DummyProject/Bar.php'),
realpath((string) getcwd() . '/tests/fixtures/DummyProject/SomeTrait.php'),
]);
$output = ob_get_clean();
$output = (string) ob_get_clean();
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);