Skip to content

Commit e545967

Browse files
authored
Merge pull request #75 from acelaya-forks/phpunit-notices
Address notices reported by latest PHPUnit
2 parents e0c45b2 + 08a3bf9 commit e545967

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"php": "^8.4",
1616
"ext-zlib": "*",
1717
"fig/http-message-util": "^1.1",
18-
"geoip2/geoip2": "^3.2",
18+
"geoip2/geoip2": "^3.3",
1919
"guzzlehttp/guzzle": "^7.10",
2020
"shlinkio/shlink-config": "^4.0",
2121
"symfony/filesystem": "^8.0 || ^7.4"
@@ -24,8 +24,7 @@
2424
"devster/ubench": "^2.1",
2525
"phpstan/phpstan": "^2.1",
2626
"phpstan/phpstan-phpunit": "^2.0",
27-
"phpunit/phpunit": "^12.4",
28-
"roave/security-advisories": "dev-master",
27+
"phpunit/phpunit": "^12.5",
2928
"shlinkio/php-coding-standard": "~2.5.0",
3029
"symfony/var-dumper": "^8.0"
3130
},

phpunit.xml.dist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
bootstrap="./vendor/autoload.php"
66
colors="true"
77
cacheDirectory="build/.phpunit.cache"
8-
displayDetailsOnTestsThatTriggerWarnings="true"
8+
displayDetailsOnPhpunitDeprecations="true"
9+
displayDetailsOnTestsThatTriggerDeprecations="true"
10+
displayDetailsOnPhpunitNotices="true"
11+
displayDetailsOnTestsThatTriggerNotices="true"
912
>
1013
<testsuites>
1114
<testsuite name="IpGeolocation">

test/GeoLite2/DbUpdaterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GuzzleHttp\Exception\ClientException;
99
use GuzzleHttp\Psr7\Request;
1010
use GuzzleHttp\Psr7\Response;
11+
use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations;
1112
use PHPUnit\Framework\Attributes\DataProvider;
1213
use PHPUnit\Framework\Attributes\Test;
1314
use PHPUnit\Framework\MockObject\MockObject;
@@ -26,6 +27,7 @@
2627

2728
use function sys_get_temp_dir;
2829

30+
#[AllowMockObjectsWithoutExpectations]
2931
class DbUpdaterTest extends TestCase
3032
{
3133
private MockObject & ClientInterface $httpClient;
@@ -146,7 +148,7 @@ public static function provideInvalidLicenses(): iterable
146148
private function dbUpdater(bool $throwOnExtract = false, string|null $licenseKey = 'foobar'): DbUpdater
147149
{
148150
$options = new GeoLite2Options($licenseKey, 'db_location', tempDir: sys_get_temp_dir());
149-
$fileExtractor = $this->createMock(FileExtractorInterface::class);
151+
$fileExtractor = $this->createStub(FileExtractorInterface::class);
150152

151153
if ($throwOnExtract) {
152154
$fileExtractor->method('extractFile')->willThrowException(ExtractException::forInvalidCompressedFile(''));

0 commit comments

Comments
 (0)