mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-11-27 04:24:50 +01:00
Fix unrelated test failure
This commit is contained in:
parent
c389fbd301
commit
ab21faac5c
@ -127,24 +127,17 @@ Feature: Assert (PHPUnit 7.5+)
|
||||
Scenario: Assert::assertIsScalar()
|
||||
Given I have the following code
|
||||
"""
|
||||
/** @psalm-suppress MixedAssignment */
|
||||
$s = mixed();
|
||||
/** @return scalar */
|
||||
function f() {
|
||||
/** @psalm-suppress MixedAssignment */
|
||||
$s = mixed();
|
||||
|
||||
Assert::assertIsScalar($s); // int|string|float|bool
|
||||
// all of the following should cause errors
|
||||
if (is_array($s)) {}
|
||||
if (is_resource($s)) {}
|
||||
if (is_object($s)) {}
|
||||
if (is_null($s)) {}
|
||||
Assert::assertIsScalar($s);
|
||||
return $s;
|
||||
}
|
||||
"""
|
||||
When I run Psalm
|
||||
Then I see these errors
|
||||
| Type | Message |
|
||||
| DocblockTypeContradiction | Found a contradiction with a docblock-defined type when evaluating $s and trying to reconcile type 'scalar' to array |
|
||||
| DocblockTypeContradiction | Cannot resolve types for $s - docblock-defined type scalar does not contain resource |
|
||||
| DocblockTypeContradiction | Found a contradiction with a docblock-defined type when evaluating $s and trying to reconcile type 'scalar' to object |
|
||||
| DocblockTypeContradiction | Cannot resolve types for $s - docblock-defined type scalar does not contain null |
|
||||
And I see no other errors
|
||||
Then I see no errors
|
||||
|
||||
Scenario: Assert::assertIsCallable()
|
||||
Given I have the following code
|
||||
|
Loading…
Reference in New Issue
Block a user