Skip to content

Commit

Permalink
test(phpunit): make data providers static
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Oct 24, 2023
1 parent bffb396 commit 5747f8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/ClassExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testAll(array $expectedClasses, string $fixture): void
}

/** @return Generator<string, array{list<string>, string}> */
public function dataProviderAll(): Generator
public static function dataProviderAll(): Generator
{
yield 'two classes' => [
[
Expand Down Expand Up @@ -63,7 +63,7 @@ public function testGetThrows(string $expectedMessage, string $path): void
}

/** @return Generator<string, array{string, string}> */
public function dataProviderGetThrows(): Generator
public static function dataProviderGetThrows(): Generator
{
yield 'enum' => ['There is no class in a file', '/Fixtures/SomeDirectory/EnumFixture.php'];
yield 'interface' => ['There is no class in a file', '/Fixtures/SomeDirectory/InterfaceFixture.php'];
Expand Down
4 changes: 2 additions & 2 deletions tests/EnumExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testAll(array $expectedClasses, string $fixture): void
}

/** @return Generator<string, array{list<string>, string}> */
public function dataProviderAll(): Generator
public static function dataProviderAll(): Generator
{
yield 'two enums' => [
[
Expand Down Expand Up @@ -63,7 +63,7 @@ public function testGetThrows(string $expectedMessage, string $path): void
}

/** @return Generator<string, array{string, string}> */
public function dataProviderGetThrows(): Generator
public static function dataProviderGetThrows(): Generator
{
yield 'class' => ['There is no enum in a file', '/Fixtures/SomeDirectory/ClassFixture.php'];
yield 'interface' => ['There is no enum in a file', '/Fixtures/SomeDirectory/InterfaceFixture.php'];
Expand Down

0 comments on commit 5747f8e

Please sign in to comment.