Skip to content

Commit e05483b

Browse files
committed
fix: Failing tests
1 parent 543d405 commit e05483b

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [ 8.2 ]
12+
php: [ 8.2, 8.3, 8.4 ]
1313

1414
steps:
1515
- name: Checkout code
@@ -50,7 +50,7 @@ jobs:
5050
- name: Setup PHP
5151
uses: shivammathur/setup-php@v2
5252
with:
53-
php-version: 8.2
53+
php-version: 8.4
5454
extensions: dom, curl, libxml, mbstring, zip
5555
tools: composer:v2
5656
coverage: none
@@ -76,7 +76,7 @@ jobs:
7676
strategy:
7777
fail-fast: true
7878
matrix:
79-
php: [ 8.2 ]
79+
php: [ 8.2, 8.3, 8.4 ]
8080
steps:
8181
- name: Checkout code
8282
uses: actions/checkout@v3

tests/Integration/JsonSerializationTest.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,15 @@ public static function deserializesWithAnExceptionProvider(): iterable
569569
JSON,
570570
];
571571

572-
yield 'DateTime' => [
573-
new DateMalformedStringException('Failed to parse time string (2020 dasd) at position 5 (d): The timezone could not be found in the database'),
574-
DateTime::class,
575-
<<<'JSON'
572+
if (version_compare(PHP_VERSION, '8.3', '>=')) {
573+
yield 'DateTime' => [
574+
new DateMalformedStringException('Failed to parse time string (2020 dasd) at position 5 (d): The timezone could not be found in the database'),
575+
DateTime::class,
576+
<<<'JSON'
576577
"2020 dasd"
577578
JSON,
578-
];
579+
];
580+
}
579581

580582
yield 'backed enum type' => [
581583
new UnexpectedTypeException(true, new UnionType([PrimitiveType::string(), PrimitiveType::integer()])),
@@ -609,15 +611,17 @@ public static function deserializesWithAnExceptionProvider(): iterable
609611
JSON,
610612
];
611613

612-
yield 'array of DateTime #1' => [
613-
new CollectionItemMappingException(0, new DateMalformedStringException('Failed to parse time string (2020 dasd) at position 5 (d): The timezone could not be found in the database')),
614-
PrimitiveType::array(
615-
new NamedType(DateTime::class)
616-
),
617-
<<<'JSON'
614+
if (version_compare(PHP_VERSION, '8.3', '>=')) {
615+
yield 'array of DateTime #1' => [
616+
new CollectionItemMappingException(0, new DateMalformedStringException('Failed to parse time string (2020 dasd) at position 5 (d): The timezone could not be found in the database')),
617+
PrimitiveType::array(
618+
new NamedType(DateTime::class)
619+
),
620+
<<<'JSON'
618621
["2020 dasd"]
619622
JSON,
620-
];
623+
];
624+
}
621625

622626
yield 'array of DateTime #2' => [
623627
new CollectionItemMappingException(1, new UnexpectedTypeException(null, PrimitiveType::string())),

0 commit comments

Comments
 (0)