Skip to content

Commit

Permalink
Dom v4 (#159)
Browse files Browse the repository at this point in the history
* build: upgrade to phpgt/dom v4

* tweak: correct namespaces for tests

* build: require php 8.1

* ci: upgrade ci to php 8.1
  • Loading branch information
g105b authored Jul 2, 2022
1 parent 5333c31 commit 42bd6f3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ jobs:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v5
- name: Install dependencies
uses: php-actions/composer@v6
with:
php_version: '8.1'

- name: Archive build
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
Expand All @@ -40,9 +43,9 @@ jobs:
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Unit tests
uses: php-actions/phpunit@v2
uses: php-actions/phpunit@v3
with:
php_version: 8.0
php_version: '8.1'
php_extensions: xdebug
configuration: test/phpunit/phpunit.xml
bootstrap: vendor/autoload.php
Expand All @@ -61,6 +64,7 @@ jobs:
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Static Analysis
uses: php-actions/phpstan@v2
uses: php-actions/phpstan@v3
with:
path: src/
php_version: '8.1'
path: src/
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"license": "MIT",

"require": {
"php": ">=7.4",
"phpgt/dom": "^3.0.0",
"php": ">=8.1",
"phpgt/dom": "^4.0.0",
"phpgt/session": "1.*"
},
"require-dev": {
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions test/phpunit/ArrayTokenStoreTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
namespace Gt\Csrf;
namespace Gt\Csrf\Test;

use Exception;
use Gt\Csrf\ArrayTokenStore;
use Gt\Csrf\Exception\CsrfTokenInvalidException;
use Gt\Csrf\Exception\CsrfTokenSpentException;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -90,4 +91,4 @@ public function testChangeTokenLimit() {
$this->expectException(CSRFTokenInvalidException::class);
$sut->verifyToken($firstToken);
}
}
}
4 changes: 3 additions & 1 deletion test/phpunit/HTMLDocumentProtectorTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace Gt\Csrf;
namespace Gt\Csrf\Test;

use Gt\Csrf\ArrayTokenStore;
use Gt\Csrf\HTMLDocumentProtector;
use Gt\Dom\HTMLDocument;
use PHPUnit\Framework\TestCase;

Expand Down
6 changes: 4 additions & 2 deletions test/phpunit/TokenStoreTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php
namespace Gt\Csrf;
namespace Gt\Csrf\Test;

use Gt\Csrf\ArrayTokenStore;
use Gt\Csrf\Exception\CsrfException;
use Gt\Csrf\Exception\CsrfTokenInvalidException;
use Gt\Csrf\Exception\CsrfTokenMissingException;
use Gt\Csrf\Exception\CsrfTokenSpentException;
use Gt\Csrf\HTMLDocumentProtector;
use PHPUnit\Framework\TestCase;
use stdClass;

Expand Down Expand Up @@ -157,4 +159,4 @@ public function testTokenLengthChange() {

self::assertNull($exception);
}
}
}

0 comments on commit 42bd6f3

Please sign in to comment.