Skip to content

Commit 7e79c91

Browse files
committed
Fix phpunit error
1 parent 6fc9ed1 commit 7e79c91

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/StringsTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,25 @@
55
namespace Rowbot\URL\Tests;
66

77
use PHPUnit\Framework\TestCase;
8+
use PHPUnit\Runner\Version;
89
use Rowbot\URL\String\Exception\RegexException;
9-
use Rowbot\URL\String\Exception\UConverterException;
1010
use Rowbot\URL\String\Exception\UndefinedIndexException;
1111
use Rowbot\URL\String\StringList;
1212
use Rowbot\URL\String\Utf8String;
1313

1414
use function is_int;
15+
use function version_compare;
1516

1617
class StringsTest extends TestCase
1718
{
1819
public function testTranscodeUnknownEncoding(): void
1920
{
20-
$this->expectWarning();
21+
if (version_compare(Version::series(), '9', '>=')) {
22+
$this->expectWarning();
23+
} else {
24+
$this->expectException(\PHPUnit\Framework\Error\Warning::class);
25+
}
26+
2127
Utf8String::transcode('stuff', 'gallifreyan', 'utf-8');
2228
}
2329

0 commit comments

Comments
 (0)