Skip to content

Commit 78c391a

Browse files
janedbalclaude
andcommitted
Fix test assertions per code review feedback
- Replace assertEmpty() with assertNoErrors() for clearer test intent - Replace assert() with assertInstanceOf() for proper PHPUnit assertions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent aa1be7d commit 78c391a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/PHPStan/Analyser/AnalyserTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,20 @@ public function testFileWithAnIgnoredErrorMessages(): void
119119
public function testFileWithAnIgnoredErrorIdentifiers(): void
120120
{
121121
$result = $this->runAnalyser([['identifiers' => ['tests.alwaysFail']]], true, __DIR__ . '/data/bootstrap-error.php', false);
122-
$this->assertEmpty($result);
122+
$this->assertNoErrors($result);
123123
}
124124

125125
public function testFileWithAnIgnoredErrorIdentifiersWithPath(): void
126126
{
127127
$result = $this->runAnalyser([['identifiers' => ['tests.alwaysFail'], 'path' => __DIR__ . '/data/bootstrap-error.php']], true, __DIR__ . '/data/bootstrap-error.php', false);
128-
$this->assertEmpty($result);
128+
$this->assertNoErrors($result);
129129
}
130130

131131
public function testFileWithAnIgnoredErrorIdentifiersWithWrongIdentifier(): void
132132
{
133133
$result = $this->runAnalyser([['identifiers' => ['wrong.identifier']]], true, __DIR__ . '/data/bootstrap-error.php', false);
134134
$this->assertCount(2, $result);
135-
assert($result[0] instanceof Error);
135+
$this->assertInstanceOf(Error::class, $result[0]);
136136
$this->assertSame('Fail.', $result[0]->getMessage());
137137
assert(is_string($result[1]));
138138
$this->assertSame('Ignored error pattern wrong.identifier was not matched in reported errors.', $result[1]);

0 commit comments

Comments
 (0)