Skip to content

Commit

Permalink
Merge pull request #64 from vierge-noire/cake5
Browse files Browse the repository at this point in the history
Cake5 compatibility
  • Loading branch information
pabloelcolombiano authored Oct 9, 2023
2 parents aa3947d + b842873 commit 079ee3c
Show file tree
Hide file tree
Showing 32 changed files with 150 additions and 1,020 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4']
php-version: ['8.1', '8.2']
db-type: [sqlite, mysql, pgsql]
composer-type: [lowest, stable, dev]
exclude:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.4']
php-version: ['8.1']

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

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ vendor
**/test_suite_light
dummy_database
composer.lock
/.phpunit.result.cache
/.phpunit.cache
/tmp/
tests/.env
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
}
],
"license": "MIT",
"minimum-stability": "dev",
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.3",
"php": ">=8.1",
"cakephp/cakephp": "^5.0",
"ext-pdo": "*"
},
"require-dev": {
"cakephp/migrations": "^3.2",
"josegonzalez/dotenv": "dev-master",
"phpunit/phpunit": "^8.5 || ^9.3"
"cakephp/migrations": "4.x-dev",
"josegonzalez/dotenv": "^4.0.0",
"phpunit/phpunit": "^10.1"
},
"autoload": {
"psr-4": {
Expand All @@ -42,7 +41,8 @@
"pgsql": "bash run_tests.sh Postgres",
"sqlite": "bash run_tests.sh Sqlite",
"phpstan": "./vendor/bin/phpstan analyse --memory-limit=-1",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:0.12.88 && mv composer.backup composer.json"
"phpstan-baseline": "./vendor/bin/phpstan --generate-baseline",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:~1.10 && mv composer.backup composer.json"
},
"config": {
"sort-packages": true
Expand Down
36 changes: 36 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
parameters:
ignoreErrors:
-
message: "#^Cannot access offset 'skipInTestSuiteLight' on mixed\\.$#"
count: 1
path: src/Fixture/TriggerStrategy.php

-
message: "#^Parameter \\#2 \\$haystack of function in_array expects array, mixed given\\.$#"
count: 1
path: src/Fixture/TriggerStrategy.php

-
message: "#^Part \\$db \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 1
path: src/Sniffer/BaseTableSniffer.php

-
message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#"
count: 1
path: src/Sniffer/BaseTableSniffer.php

-
message: "#^Cannot access offset 'tableSniffer' on mixed\\.$#"
count: 2
path: src/Sniffer/SnifferRegistry.php

-
message: "#^Part \\$driver \\(mixed\\) of encapsed string cannot be cast to string\\.$#"
count: 1
path: src/Sniffer/SnifferRegistry.php

-
message: "#^Cannot access offset 'driver' on mixed\\.$#"
count: 1
path: tests/TestApp/config/Migrations/20200208100000_initial_migration.php
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
includes:
- phpstan-baseline.neon

parameters:
level: max
checkMissingIterableValueType: false
Expand Down
30 changes: 16 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./tests/bootstrap.php"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
cacheDirectory=".phpunit.cache">

<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="Default">
<directory>./tests/TestCase/</directory>
</testsuite>
<testsuite name="Default">
<directory>./tests/TestCase/</directory>
</testsuite>
</testsuites>

<!-- Setup a listener for fixtures -->
<extensions>
<extension class="\Cake\TestSuite\Fixture\PHPUnitExtension" />
<bootstrap class="\Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
</extensions>

<!-- Ignore vendor tests in code coverage reports -->
<filter>
<whitelist>
<source>
<include>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
</include>
</source>
</phpunit>
117 changes: 0 additions & 117 deletions src/FixtureInjector.php

This file was deleted.

Loading

0 comments on commit 079ee3c

Please sign in to comment.