Skip to content

Commit 2db1176

Browse files
committed
fix: restore PHPUnit 9.6 compatibility after rebase
- Reverted phpunit.xml.dist to PHPUnit 9.3 schema (compatible with PHPUnit 9.6) - Changed HarTest to use @dataProvider docblock instead of PHP 8 attributes - Changed fixtureDataProvider from static to instance method The rebase introduced PHPUnit 12.5 schema and PHP 8 attribute syntax which are not compatible with the current PHPUnit 9.6 version used in the project.
1 parent 6ef4876 commit 2db1176

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

‎phpunit.xml.dist‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3-
<coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">./src</directory>
6+
</include>
47
<report>
58
<clover outputFile="build/logs/clover.xml"/>
69
</report>
@@ -16,9 +19,4 @@
1619
<logging>
1720
<junit outputFile="build/logs/results.xml"/>
1821
</logging>
19-
<source>
20-
<include>
21-
<directory suffix=".php">./src</directory>
22-
</include>
23-
</source>
2422
</phpunit>

‎tests/src/Unit/HarTest.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
use Deviantintegral\Har\Har;
99
use Deviantintegral\Har\Log;
1010
use Deviantintegral\Har\Serializer;
11-
use PHPUnit\Framework\Attributes\DataProvider;
1211

1312
class HarTest extends HarTestBase
1413
{
1514
/**
1615
* Tests deserializing and reserializing a complete HAR file.
16+
*
17+
* @dataProvider fixtureDataProvider
1718
*/
18-
#[DataProvider('fixtureDataProvider')]
1919
public function testExportedFixture(string $id, Har $har)
2020
{
2121
$repository = $this->getHarFileRepository();
@@ -28,9 +28,9 @@ public function testExportedFixture(string $id, Har $har)
2828
$this->assertEquals($jsonDecode, json_decode($serialized, true));
2929
}
3030

31-
public static function fixtureDataProvider()
31+
public function fixtureDataProvider()
3232
{
33-
$repository = new \Deviantintegral\Har\Repository\HarFileRepository(__DIR__.'/../../fixtures');
33+
$repository = $this->getHarFileRepository();
3434

3535
foreach ($repository->loadMultiple() as $id => $har) {
3636
yield [$id, $har];

0 commit comments

Comments
 (0)