Skip to content

Commit a121777

Browse files
committed
Add PHP 8.2 support
1 parent 33838e3 commit a121777

File tree

2 files changed

+31
-15
lines changed

2 files changed

+31
-15
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
continue-on-error: ${{ matrix.experimental }}
1010
strategy:
1111
matrix:
12-
php: ['7.4', '8.0', '8.1']
12+
php: ['7.4', '8.0', '8.1', '8.2']
1313
experimental: [false]
1414
include:
15-
- php: '8.1'
15+
- php: '8.2'
1616
analysis: true
1717

1818
steps:

tests/DotTest.php

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -812,19 +812,35 @@ public function testVarExport(): void
812812
{
813813
$dot = new Dot(['foo' => ['bar' => 'baz']]);
814814

815-
$this->assertEquals(
816-
"Adbar\Dot::__set_state(array(\n" .
817-
" 'items' => \n" .
818-
" array (\n" .
819-
" 'foo' => \n" .
820-
" array (\n" .
821-
" 'bar' => 'baz',\n" .
822-
" ),\n" .
823-
" ),\n" .
824-
" 'delimiter' => '.',\n" .
825-
"))",
826-
var_export($dot, true)
827-
);
815+
if (version_compare(PHP_VERSION, '8.2.0') >= 0) {
816+
$this->assertEquals(
817+
"\Adbar\Dot::__set_state(array(\n" .
818+
" 'items' => \n" .
819+
" array (\n" .
820+
" 'foo' => \n" .
821+
" array (\n" .
822+
" 'bar' => 'baz',\n" .
823+
" ),\n" .
824+
" ),\n" .
825+
" 'delimiter' => '.',\n" .
826+
"))",
827+
var_export($dot, true)
828+
);
829+
} else {
830+
$this->assertEquals(
831+
"Adbar\Dot::__set_state(array(\n" .
832+
" 'items' => \n" .
833+
" array (\n" .
834+
" 'foo' => \n" .
835+
" array (\n" .
836+
" 'bar' => 'baz',\n" .
837+
" ),\n" .
838+
" ),\n" .
839+
" 'delimiter' => '.',\n" .
840+
"))",
841+
var_export($dot, true)
842+
);
843+
}
828844
}
829845

830846
/*

0 commit comments

Comments
 (0)