Skip to content

Commit

Permalink
tests: support PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Aug 17, 2024
1 parent 6d5b958 commit fd57341
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"symfony/console": "~3.4|~4.3|^5|^6"
},
"require-dev": {
"phpunit/phpunit": "^8 || ^9 || ^10",
"phpunit/phpunit": "^8 || ^9 || ^10|| ^11",
"phpstan/phpstan": "^1.4.6",
"wdes/coding-standard": "^3.2"
},
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/CheckstyleErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param int $numGenericErrors
* @param string $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/GithubErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param int $numGenericErrors
* @param string $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/GitlabFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param string $expected
*
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/ErrorFormatter/JsonErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param int $numGenericErrors
* @param string $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testPrettyFormatErrors(
string $message,
int $exitCode,
Expand Down Expand Up @@ -257,6 +258,7 @@ public function testPrettyFormatErrors(
* @param string $expected
*
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/JunitErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public static function dataFormatterOutputProvider(): Generator
*
* @dataProvider dataFormatterOutputProvider
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
int $exitCode,
int $numFileErrors,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/RawErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param int $numGenericErrors
* @param string $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/TableErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param int $numGenericErrors
* @param string $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/ErrorFormatter/TeamcityErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public static function dataFormatterOutputProvider(): iterable
* @param int $numGenericErrors
* @param string $expected
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataFormatterOutputProvider')]
public function testFormatErrors(
string $message,
int $exitCode,
Expand Down
5 changes: 5 additions & 0 deletions tests/Unit/OutputFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static function dataProviderFormatsNames(): array
/**
* @dataProvider dataProviderFormatsNames
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataProviderFormatsNames')]
public function testValidFormats(string $formatName): void
{
$this->assertTrue(OutputFormat::checkOutputFormatIsValid($formatName));
Expand All @@ -40,6 +41,7 @@ public function testValidFormats(string $formatName): void
/**
* @dataProvider dataProviderFormatsNames
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataProviderFormatsNames')]
public function testInValidFormats(string $formatName): void
{
$formatName = 'foo' . $formatName;
Expand All @@ -54,6 +56,7 @@ public function testInValidFormats(string $formatName): void
/**
* @dataProvider dataProviderFormatsNames
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataProviderFormatsNames')]
public function testGetFormatterForChoice(string $formatName): void
{
$this->assertInstanceOf(ErrorFormatter::class, OutputFormat::getFormatterForChoice($formatName, new NullRelativePathHelper()));
Expand All @@ -62,6 +65,7 @@ public function testGetFormatterForChoice(string $formatName): void
/**
* @dataProvider dataProviderFormatsNames
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataProviderFormatsNames')]
public function testGetFormatterForChoiceInvalid(string $formatName): void
{
$formatName = 'foo' . $formatName;
Expand All @@ -75,6 +79,7 @@ public function testGetFormatterForChoiceInvalid(string $formatName): void
/**
* @dataProvider dataProviderFormatsNames
*/
#[\PHPUnit\Framework\Attributes\DataProvider('dataProviderFormatsNames')]
public function testFormatterForChoice(string $formatName): void
{
OutputFormat::displayUserChoiceFormat(
Expand Down

0 comments on commit fd57341

Please sign in to comment.