Skip to content

Commit 42bd6f3

Browse files
author
Greg Bowler
authored
Dom v4 (#159)
* build: upgrade to phpgt/dom v4 * tweak: correct namespaces for tests * build: require php 8.1 * ci: upgrade ci to php 8.1
1 parent 5333c31 commit 42bd6f3

File tree

6 files changed

+32
-23
lines changed

6 files changed

+32
-23
lines changed

.github/workflows/ci.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ jobs:
1515
path: /tmp/composer-cache
1616
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
1717

18-
- uses: php-actions/composer@v5
18+
- name: Install dependencies
19+
uses: php-actions/composer@v6
20+
with:
21+
php_version: '8.1'
1922

2023
- name: Archive build
2124
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
@@ -40,9 +43,9 @@ jobs:
4043
run: tar -xvf /tmp/github-actions/build.tar ./
4144

4245
- name: PHP Unit tests
43-
uses: php-actions/phpunit@v2
46+
uses: php-actions/phpunit@v3
4447
with:
45-
php_version: 8.0
48+
php_version: '8.1'
4649
php_extensions: xdebug
4750
configuration: test/phpunit/phpunit.xml
4851
bootstrap: vendor/autoload.php
@@ -61,6 +64,7 @@ jobs:
6164
run: tar -xvf /tmp/github-actions/build.tar ./
6265

6366
- name: PHP Static Analysis
64-
uses: php-actions/phpstan@v2
67+
uses: php-actions/phpstan@v3
6568
with:
66-
path: src/
69+
php_version: '8.1'
70+
path: src/

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "MIT",
66

77
"require": {
8-
"php": ">=7.4",
9-
"phpgt/dom": "^3.0.0",
8+
"php": ">=8.1",
9+
"phpgt/dom": "^4.0.0",
1010
"phpgt/session": "1.*"
1111
},
1212
"require-dev": {

composer.lock

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/phpunit/ArrayTokenStoreTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
2-
namespace Gt\Csrf;
2+
namespace Gt\Csrf\Test;
33

44
use Exception;
5+
use Gt\Csrf\ArrayTokenStore;
56
use Gt\Csrf\Exception\CsrfTokenInvalidException;
67
use Gt\Csrf\Exception\CsrfTokenSpentException;
78
use PHPUnit\Framework\TestCase;
@@ -90,4 +91,4 @@ public function testChangeTokenLimit() {
9091
$this->expectException(CSRFTokenInvalidException::class);
9192
$sut->verifyToken($firstToken);
9293
}
93-
}
94+
}

test/phpunit/HTMLDocumentProtectorTest.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
2-
namespace Gt\Csrf;
2+
namespace Gt\Csrf\Test;
33

4+
use Gt\Csrf\ArrayTokenStore;
5+
use Gt\Csrf\HTMLDocumentProtector;
46
use Gt\Dom\HTMLDocument;
57
use PHPUnit\Framework\TestCase;
68

test/phpunit/TokenStoreTest.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
2-
namespace Gt\Csrf;
2+
namespace Gt\Csrf\Test;
33

4+
use Gt\Csrf\ArrayTokenStore;
45
use Gt\Csrf\Exception\CsrfException;
56
use Gt\Csrf\Exception\CsrfTokenInvalidException;
67
use Gt\Csrf\Exception\CsrfTokenMissingException;
78
use Gt\Csrf\Exception\CsrfTokenSpentException;
9+
use Gt\Csrf\HTMLDocumentProtector;
810
use PHPUnit\Framework\TestCase;
911
use stdClass;
1012

@@ -157,4 +159,4 @@ public function testTokenLengthChange() {
157159

158160
self::assertNull($exception);
159161
}
160-
}
162+
}

0 commit comments

Comments
 (0)