Skip to content

Commit

Permalink
Update PHPUnit, remove deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Jan 15, 2024
1 parent 05ccf55 commit e16a84a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0",
"phpunit/phpunit": "^9.6.15",
"symfony/var-dumper": "^3.3 || ^4.0 || ^5.0"
},
"minimum-stability": "stable",
Expand Down
17 changes: 9 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="unit">
Expand All @@ -13,11 +14,11 @@
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</include>
</coverage>

<php>
<!-- E_ALL = 30719 -->
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Http/RequestManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function shouldSendAndDecodeRequest(): void
// Assert properties of the send request
$recordedRequests = $mockClient->getRequests();
$this->assertCount(1, $recordedRequests);
$this->assertRegExp(
$this->assertMatchesRegularExpression(
'~https\://account\-id\.matej\.lmc\.cz/foo/endpoint\?hmac_timestamp\=[0-9]+&hmac_sign\=[[:alnum:]]~',
$recordedRequests[0]->getUri()->__toString()
);
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Http/ResponseDecoderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public function shouldDecodeRecommendationResponse(): void
$this->assertContainsOnlyInstancesOf(\stdClass::class, $decodedResponse->getRecommendation()->getData());

foreach ($decodedResponse->getRecommendation()->getData() as $recommendedItem) {
$this->assertObjectHasAttribute('item_id', $recommendedItem);
$this->assertObjectHasAttribute('item_url', $recommendedItem);
$this->assertObjectHasProperty('item_id', $recommendedItem);
$this->assertObjectHasProperty('item_url', $recommendedItem);
}
}
}

0 comments on commit e16a84a

Please sign in to comment.