Skip to content

Commit 9d4cb70

Browse files
committed
bug #147 Add support for PHP 8.1 and 8.2 (javiereguiluz, wouterj)
This PR was merged into the main branch. Discussion ---------- Add support for PHP 8.1 and 8.2 Commits ------- dcd1a74 Always install masterminds/html5 and enable HTML5 parsing f83b8bd Add support for PHP 8.1 and 8.2
2 parents 89e408b + dcd1a74 commit 9d4cb70

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
fail-fast: false
3636
matrix:
37-
php-version: ['7.4', '8.0']
37+
php-version: ['7.4', '8.0', '8.1', '8.2']
3838

3939
steps:
4040
- name: 'Checkout code'

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"require-dev": {
3131
"gajus/dindent": "^2.0",
3232
"symfony/phpunit-bridge": "^5.2 || ^6.0",
33-
"symfony/process": "^5.2 || ^6.0"
33+
"symfony/process": "^5.2 || ^6.0",
34+
"masterminds/html5": "^2.7"
3435
},
3536
"bin": ["bin/docs-builder"]
3637
}

tests/IntegrationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ public function testParseUnitBlock(string $blockName)
106106

107107
$actualHtml = $parser->parseFile($sourceFile)->renderDocument();
108108
$expectedHtml = file_get_contents(sprintf('%s/fixtures/expected/blocks/%s.html', __DIR__, $blockName));
109+
if (false === stripos($expectedHtml, '<!doctype')) {
110+
$expectedHtml = '<!DOCTYPE html><body>'.$expectedHtml.'</body>';
111+
}
109112

110113
$actualCrawler = new Crawler($actualHtml);
111114
$expectedCrawler = new Crawler($expectedHtml);

0 commit comments

Comments
 (0)