Skip to content

feat: upgrade php-casbin 4.0 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml → .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: PHPUnit

on:
push:
Expand Down Expand Up @@ -37,14 +37,14 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 5.6, 7.0, 7.1, 7.2, 7.3, 7.4 ]
php: [ 8.1, 8.2, 8.3 ]
stability: [ prefer-lowest, prefer-stable ]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -87,10 +87,10 @@ jobs:
runs-on: ubuntu-latest
needs: [ test, upload-coverage ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '12'
node-version: 'lts/*'

- name: Run semantic-release
env:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ composer.lock
*.iml

# coverage report
/build
/build

.phpunit.*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Laminas-db Adapter for PHP-Casbin

[![Build Status](https://travis-ci.org/php-casbin/laminas-db-adapter.svg?branch=master)](https://travis-ci.org/php-casbin/laminas-db-adapter)
[![PHPUnit](https://github.com/php-casbin/laminas-db-adapter/actions/workflows/phpunit.yml/badge.svg)](https://github.com/php-casbin/laminas-db-adapter/actions/workflows/phpunit.yml)
[![Coverage Status](https://coveralls.io/repos/github/php-casbin/laminas-db-adapter/badge.svg)](https://coveralls.io/github/php-casbin/laminas-db-adapter)
[![Latest Stable Version](https://poser.pugx.org/casbin/laminas-db-adapter/v/stable)](https://packagist.org/packages/casbin/laminas-db-adapter)
[![Total Downloads](https://poser.pugx.org/casbin/laminas-db-adapter/downloads)](https://packagist.org/packages/casbin/laminas-db-adapter)
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"test": "vendor/bin/phpunit"
},
"require": {
"casbin/casbin": "~3.1",
"laminas/laminas-db": "^2.11"
"php": ">=8.1",
"casbin/casbin": "~4.0",
"laminas/laminas-db": "^2.19"
},
"require-dev": {
"phpunit/phpunit": "~5.7|~6.0|~7.0",
"php-coveralls/php-coveralls": "^2.1"
"phpunit/phpunit": "~10.0",
"php-coveralls/php-coveralls": "^2.4"
},
"autoload": {
"psr-4": {
Expand Down
42 changes: 22 additions & 20 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false" backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-html" target="build/html"/>
</logging>
<php>
<env name="DB_DATABASE" value="casbin"/>
</php>
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/html"/>
</report>
</coverage>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<logging/>
<php>
<env name="DB_DATABASE" value="casbin"/>
</php>
</phpunit>