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

Make it more clear what do we test from Psalm output

This commit is contained in:
Alies Lapatsin 2023-01-05 18:12:29 +04:00
parent 94f9d48bca
commit 5ffb4f2938

View File

@ -38,13 +38,6 @@ class ProjectCheckerTest extends TestCase
protected ProjectAnalyzer $project_analyzer; 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 public static function setUpBeforeClass(): void
{ {
self::$config = new TestConfig(); self::$config = new TestConfig();
@ -102,7 +95,9 @@ class ProjectCheckerTest extends TestCase
$this->project_analyzer->check('tests/fixtures/DummyProject'); $this->project_analyzer->check('tests/fixtures/DummyProject');
$output = ob_get_clean(); $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()); $this->assertSame(0, IssueBuffer::getErrorCount());
@ -287,7 +282,9 @@ class Bat
$this->project_analyzer->checkDir('tests/fixtures/DummyProject'); $this->project_analyzer->checkDir('tests/fixtures/DummyProject');
$output = ob_get_clean(); $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()); $this->assertSame(0, IssueBuffer::getErrorCount());
@ -326,7 +323,9 @@ class Bat
]); ]);
$output = ob_get_clean(); $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()); $this->assertSame(0, IssueBuffer::getErrorCount());
@ -365,7 +364,9 @@ class Bat
]); ]);
$output = ob_get_clean(); $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()); $this->assertSame(0, IssueBuffer::getErrorCount());