Skip to content

Commit

Permalink
PHP 8.3 support (#31)
Browse files Browse the repository at this point in the history
* Include PHP 8.3 in test pipeline

* phpunit.xml.dist: be verbose about deprecations

* NtriplesTest.php: replace utf8_encode with mb_convert_encoding
  • Loading branch information
k00ni authored Jul 11, 2023
1 parent 15062c3 commit d5b47f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout
Expand Down
10 changes: 2 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="test/bootstrap.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="test/bootstrap.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false"
displayDetailsOnTestsThatTriggerDeprecations="true">
<coverage/>
<php>
<!--
Fix for coverage report causing Seg Fault
(see https://bugs.php.net/bug.php?id=53976)
-->
<ini name="zend.enable_gc" value="0"/>
</php>
<testsuites>
<testsuite name="EasyRdf Library">
<directory suffix="Test.php">tests/EasyRdf/</directory>
Expand Down
6 changes: 4 additions & 2 deletions tests/EasyRdf/Serialiser/NtriplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ public function testMixedWithControlCharacters()
$serializer = new Ntriples();
// Include the NULL byte, a character, a control character,
// a multibyte character, a character, and a character outside the BMP.
$string = utf8_encode(\chr(0).'a'.\chr(31)).''.utf8_encode(\chr(127)).'𐀐';
$string = mb_convert_encoding(\chr(0).'a'.\chr(31), 'UTF-8', 'ISO-8859-1');
$string .= ''.mb_convert_encoding(\chr(127), 'UTF-8', 'ISO-8859-1').'𐀐';

$literal = new Literal($string);
$actual = $serializer->serialiseValue($literal);
$this->assertEquals('"'.$string.'"', $actual);
Expand All @@ -329,7 +331,7 @@ public function testUnintendedMultibyteCharacter()
// separate characters and not confused with multibyte characters.
$string = "\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF";
// Converts the string to 'ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ'.
$string = utf8_encode($string);
$string = mb_convert_encoding($string, 'UTF-8', 'ISO-8859-1');
$literal = new Literal($string);
$actual = $serializer->serialiseValue($literal);
$expected = '"ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ"';
Expand Down

0 comments on commit d5b47f2

Please sign in to comment.