Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it more clear what do we test from Psalm output #9061

Merged
merged 1 commit into from
Jan 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 12 additions & 11 deletions tests/ProjectCheckerTest.php
Expand Up @@ -38,13 +38,6 @@ class ProjectCheckerTest extends TestCase

protected ProjectAnalyzer $project_analyzer;

private const EXPECTED_OUTPUT = "Target PHP version: 8.1 (set by tests) Extensions enabled: dom, simplexml "
. "(unsupported extensions: ctype, json, libxml, mbstring, tokenizer)\n"
. "Scanning files...\n"
. "Analyzing files...\n"
. "\n"
;

public static function setUpBeforeClass(): void
{
self::$config = new TestConfig();
Expand Down Expand Up @@ -102,7 +95,9 @@ public function testCheck(): void
$this->project_analyzer->check('tests/fixtures/DummyProject');
$output = ob_get_clean();

$this->assertSame(self::EXPECTED_OUTPUT, $output);
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
$this->assertStringContainsString('Analyzing files...', $output);

$this->assertSame(0, IssueBuffer::getErrorCount());

Expand Down Expand Up @@ -287,7 +282,9 @@ public function testCheckDir(): void
$this->project_analyzer->checkDir('tests/fixtures/DummyProject');
$output = ob_get_clean();

$this->assertSame(self::EXPECTED_OUTPUT, $output);
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
$this->assertStringContainsString('Analyzing files...', $output);

$this->assertSame(0, IssueBuffer::getErrorCount());

Expand Down Expand Up @@ -326,7 +323,9 @@ public function testCheckPaths(): void
]);
$output = ob_get_clean();

$this->assertSame(self::EXPECTED_OUTPUT, $output);
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
$this->assertStringContainsString('Analyzing files...', $output);

$this->assertSame(0, IssueBuffer::getErrorCount());

Expand Down Expand Up @@ -365,7 +364,9 @@ public function testCheckFile(): void
]);
$output = ob_get_clean();

$this->assertSame(self::EXPECTED_OUTPUT, $output);
$this->assertStringContainsString('Target PHP version: 8.1 (set by tests)', $output);
$this->assertStringContainsString('Scanning files...', $output);
$this->assertStringContainsString('Analyzing files...', $output);

$this->assertSame(0, IssueBuffer::getErrorCount());

Expand Down