Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and github-actions[bot] committed Sep 29, 2023
1 parent 03aefd4 commit e3be944
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.18",
"psalm/plugin-symfony": "^5.0",
"rector/rector": "^0.17",
"rector/rector": "^0.18",
"symfony/config": "^5.4 || ^6.2",
"symfony/dependency-injection": "^5.4 || ^6.2",
"symfony/http-foundation": "^5.4 || ^6.2",
Expand Down
18 changes: 8 additions & 10 deletions tests/ExporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testGetAvailableFormats(): void
}

/**
* @dataProvider getGetResponseTests
* @dataProvider provideGetResponseCases
*/
public function testGetResponse(string $format, string $filename, string $contentType, string $expectedOutput): void
{
Expand Down Expand Up @@ -90,16 +90,14 @@ public function testGetResponse(string $format, string $filename, string $conten
}

/**
* @return array<array{string, string, string, string}>
* @return iterable<array{string, string, string, string}>
*/
public function getGetResponseTests(): array
public function provideGetResponseCases(): iterable
{
return [
['json', 'foo.json', 'application/json', '#foo#'],
['xml', 'foo.xml', 'text/xml', '#foo#'],
['xls', 'foo.xls', 'application/vnd.ms-excel', '#foo#'],
['csv', 'foo.csv', 'text/csv', '#foo#'],
['made-up', 'foo.made-up', 'application/made-up', '##'],
];
yield ['json', 'foo.json', 'application/json', '#foo#'];
yield ['xml', 'foo.xml', 'text/xml', '#foo#'];
yield ['xls', 'foo.xls', 'application/vnd.ms-excel', '#foo#'];
yield ['csv', 'foo.csv', 'text/csv', '#foo#'];
yield ['made-up', 'foo.made-up', 'application/made-up', '##'];
}
}
6 changes: 3 additions & 3 deletions tests/Source/AbstractPropertySourceIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
final class AbstractPropertySourceIteratorTest extends TestCase
{
/**
* @dataProvider getValueProvider
* @dataProvider provideGetValueCases
*/
public function testGetValue(mixed $value, mixed $expected, string $dateFormat = 'r'): void
{
Expand All @@ -41,9 +41,9 @@ public function getValue(mixed $value): bool|int|float|string|null
}

/**
* @return array<array{0: mixed, 1: mixed, 2?: string}>
* @return iterable<array{0: mixed, 1: mixed, 2?: string}>
*/
public function getValueProvider(): array
public function provideGetValueCases(): iterable
{
$datetime = new \DateTime();
$dateTimeImmutable = new \DateTimeImmutable();
Expand Down
2 changes: 1 addition & 1 deletion tests/Writer/JsonWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public function testWrite(): void
['john 3', 'doe', '1'],
];

static::assertSame($expected, json_decode($content, false));
static::assertSame($expected, json_decode($content, false, 512, \JSON_THROW_ON_ERROR));
}
}

0 comments on commit e3be944

Please sign in to comment.