Skip to content

Commit 369ad89

Browse files
committed
BREAKING CHANGE: upgrade to PHP 8.0 and PHP-Casbin 4.0
1 parent d3c171a commit 369ad89

File tree

4 files changed

+29
-22
lines changed

4 files changed

+29
-22
lines changed

.github/workflows/build.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ jobs:
2323
strategy:
2424
fail-fast: true
2525
matrix:
26-
php: [ 7.2, 7.3,7.4,8.0 ]
26+
php: [ 8.0, 8.1, 8.2, 8.3, 8.4 ]
2727

28-
stability: [ prefer-lowest, prefer-stable ]
29-
30-
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
28+
name: PHP ${{ matrix.php }}
3129

3230
steps:
3331
- name: Checkout code
@@ -57,7 +55,7 @@ jobs:
5755
COVERALLS_PARALLEL: true
5856
COVERALLS_FLAG_NAME: ${{ runner.os }} - ${{ matrix.php }}
5957
run: |
60-
composer global require php-coveralls/php-coveralls:^2.4
58+
composer global require php-coveralls/php-coveralls:^2.7
6159
php-coveralls --coverage_clover=build/logs/clover.xml -v
6260
6361
upload-coverage:

composer.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,17 @@
2222
"test": "vendor/bin/phpunit"
2323
},
2424
"require": {
25-
"php": ">=7.2",
26-
"codeigniter4/framework": "^4",
27-
"casbin/casbin": "^3.21.6",
28-
"casbin/psr3-bridge": "^1.1"
25+
"php": "^8.1",
26+
"codeigniter4/framework": "^4.5",
27+
"casbin/casbin": "^4.0.2"
2928
},
3029
"autoload": {
3130
"psr-4": {
3231
"Casbin\\CodeIgniter\\": "src/"
3332
}
3433
},
3534
"require-dev": {
36-
"phpunit/phpunit": "^7.0|^8.0|^9.0",
37-
"php-coveralls/php-coveralls": "^2.1"
35+
"phpunit/phpunit": "^10.0|^11.0"
3836
},
3937
"autoload-dev": {
4038
"psr-4": {

phpunit.xml.dist

+17-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,23 @@
1414
<directory>./tests</directory>
1515
</testsuite>
1616
</testsuites>
17-
<filter>
18-
<whitelist processUncoveredFilesFromWhitelist="true">
19-
<directory suffix=".php">./src</directory>
20-
</whitelist>
21-
</filter>
22-
<logging>
23-
<log type="coverage-clover" target="build/logs/clover.xml"/>
24-
<log type="coverage-html" target="build/html"/>
25-
</logging>
17+
18+
<coverage includeUncoveredFiles="true"
19+
pathCoverage="false"
20+
ignoreDeprecatedCodeUnits="true"
21+
disableCodeCoverageIgnore="true">
22+
<report>
23+
<clover outputFile="build/logs/clover.xml"/>
24+
<html outputDirectory="build/html" lowUpperBound="50" highLowerBound="90"/>
25+
</report>
26+
</coverage>
27+
28+
<source>
29+
<include>
30+
<directory>./src</directory>
31+
</include>
32+
</source>
33+
2634
<php>
2735
<env name="app.baseURL" value="http://example.com"/>
2836
<env name="database.tests.hostname" value="127.0.0.1"/>

tests/EnforcerManagerTest.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
namespace Casbin\CodeIgniter\Tests;
44

5-
use CodeIgniter\Test\CIDatabaseTestCase;
5+
use CodeIgniter\Test\CIUnitTestCase;
6+
use CodeIgniter\Test\DatabaseTestTrait;
67
use Config\Services
78
;
89
use Config\Autoload;
910
use Config\Modules;
1011

11-
class EnforcerManagerTest extends CIDatabaseTestCase
12+
class EnforcerManagerTest extends CIUnitTestCase
1213
{
14+
use DatabaseTestTrait;
15+
1316
protected function createApplication()
1417
{
1518
$app = parent::createApplication();

0 commit comments

Comments
 (0)