Skip to content

Commit b3bbd12

Browse files
committed
Update tests with info received in review, rename test method to match the filename
1 parent 9d2a0e6 commit b3bbd12

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testExtension(): void
4747
]);
4848
}
4949

50-
public function testEq(): void
50+
public function testEqNotEq(): void
5151
{
5252
$this->analyse([__DIR__ . '/data/impossible-check-eq-not-eq.php'], [
5353
[
@@ -60,15 +60,15 @@ public function testEq(): void
6060
],
6161
[
6262
'Call to static method Webmozart\Assert\Assert::eq() with stdClass and stdClass will always evaluate to true.',
63-
29,
63+
30,
6464
],
6565
[
6666
'Call to static method Webmozart\Assert\Assert::eq() with stdClass and null will always evaluate to false.',
67-
32,
67+
33,
6868
],
6969
[
7070
'Call to static method Webmozart\Assert\Assert::notEq() with stdClass and null will always evaluate to true.',
71-
33,
71+
34,
7272
],
7373
]);
7474
}

tests/Type/WebMozartAssert/data/impossible-check-eq-not-eq.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ function instancesOfTheSameTypeAreNotIdenticalButCouldBeEqual(stdClass $a, stdCl
2323

2424
function instancesOfDifferentTypesAreNeverEqual(stdClass $a, DateTimeInterface $b, stdClass $c, DateTimeInterface $d, stdClass $e, stdClass $f, stdClass $g, stdClass $h): void
2525
{
26-
Assert::eq($a, $b); // ignored, should evaluate to false?
27-
Assert::notEq($c, $d); // ignored, should evaluate to true?
26+
// These don't report anything as PHPStan doesn't currently support loose comparison with ==
27+
Assert::eq($a, $b);
28+
Assert::notEq($c, $d);
2829

29-
Assert::eq($e, new stdClass()); // will always evaluate to true, should evaluate to false?
30-
Assert::notEq($f, new stdClass()); // ignored, should evaluate to true?
30+
Assert::eq($e, new stdClass()); // will always evaluate to true, should not report anything
31+
Assert::notEq($f, new stdClass());
3132

3233
Assert::eq($g, null); // will always evaluate to false
3334
Assert::notEq($h, null); // will always evaluate to true

0 commit comments

Comments
 (0)