Skip to content

Commit

Permalink
Merge pull request #9061 from lptn/cleaner_assertions
Browse files Browse the repository at this point in the history
Make it more clear what do we test from Psalm output
  • Loading branch information
orklah committed Jan 7, 2023
2 parents 4ec4ed7 + 5ffb4f2 commit 729c0ba
Showing 1 changed file with 12 additions and 11 deletions.
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

0 comments on commit 729c0ba

Please sign in to comment.