Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Mar 15, 2024
1 parent 0b108f9 commit 9732c24
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
3 changes: 2 additions & 1 deletion src/Hooks/TestCaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public static function afterClassLikeVisit(AfterClassLikeVisitEvent $event)

/**
* {@inheritDoc}
*

Check failure on line 109 in src/Hooks/TestCaseHandler.php

View workflow job for this annotation

GitHub Actions / Code style

Whitespace found at end of line
* @psalm-suppress DeprecatedClass TList will be removed soon
*/
public static function afterStatementAnalysis(AfterClassLikeAnalysisEvent $event)
{
Expand Down Expand Up @@ -387,7 +389,6 @@ static function (
}
};

/** @psalm-suppress DeprecatedClass Will be removed soon */
/** @var Type\Atomic\TArray|Type\Atomic\TKeyedArray|Type\Atomic\TList $dataset_type */
$dataset_type = self::getAtomics($provider_return_type->type_params[1])['array'];

Expand Down
19 changes: 0 additions & 19 deletions tests/acceptance/Prophecy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,6 @@ Feature: Prophecy
When I run Psalm
Then I see no errors

Scenario: Argument::that() only accepts callable with boolean return type
Given I have the following code
"""
class MyTestCase extends TestCase
{
/** @return void */
public function testSomething() {
$_argument = Argument::that(function (): string {
return 'hello';
});
}
}
"""
When I run Psalm
Then I see these errors
| Type | Message |
| InvalidScalarArgument | /Argument 1 of Prophecy\\Argument::that expects callable\(mixed...\):bool, (but )?(pure-)?Closure\(\):(string\(hello\)\|"hello"\|'hello') provided/ |
And I see no other errors

Scenario: Argument::that() only accepts callable with boolean return type [Psalm 5]
Given I have the following code
"""
Expand Down
25 changes: 1 addition & 24 deletions tests/acceptance/TestCase.feature
Original file line number Diff line number Diff line change
Expand Up @@ -612,29 +612,6 @@ Feature: TestCase
When I run Psalm
Then I see no errors

Scenario: Provider omitting offsets is fine when test method has defaults for those params (specified as constants)
Given I have the following code
"""
class MyTestCase extends TestCase
{
/** @var string */
const S = "s";
/** @return iterable<string,array{0:int}> */
public function provide() {
yield "data set name" => rand(0,1) ? [1] : [1, "ss"];
}
/**
* @return void
* @dataProvider provide
*/
public function testSomething(int $int, string $_str = self::S) {
$this->assertEquals(1, $int);
}
}
"""
When I run Psalm
Then I see no errors

Scenario: Provider omitting offsets is fine when test method has defaults for those params (specified as constants) [Psalm 5]
Given I have the following code
"""
Expand Down Expand Up @@ -1280,7 +1257,7 @@ Feature: TestCase
Given I have the following code
"""
class MyTestCase extends TestCase {
/** @return iterable<string, list<string>> */
/** @return iterable<string, non-empty-list<string>> */
public function provide(): iterable {
yield "dataset name" => ["1"];
}
Expand Down

0 comments on commit 9732c24

Please sign in to comment.