-
Notifications
You must be signed in to change notification settings - Fork 33
Prepare for CakePHP 5.x #194
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
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
b862395
Fix PHPUnit 9 deprecations.
kevindecapite c2b8fdd
vendor/bin/phpunit --migrate-configuration
kevindecapite b427932
Fix CakePHP 4.x deprecations.
kevindecapite 728ba22
Upgrade to new fixture management per CakePHP 4.3.0.
kevindecapite d2862c0
Refactor match() to switch in JsonApiListenerTest.
kevindecapite c35b6a9
Use actions/cache@v4 in GitHub workflow ci.yml.
kevindecapite be0deb2
Make PHP 8.1 lowest-supported version.
kevindecapite d7939c3
Set composer.json requirements:
kevindecapite 373cf25
Change type declarations and method signatures per Cake 5 upgrade.
kevindecapite 857a997
ORM: fetchTable() instead of ProxyTrait::_table(); orderBy() instead …
kevindecapite 0188935
Remove RequestHandler component from test_app controllers.
kevindecapite 3ccf903
Update tests/bootstrap.php per Cake 5 upgrade.
kevindecapite 6847552
Update PaginationListener.
kevindecapite 5c4e201
Add missing use statements for Cake functions.
kevindecapite 3d5a764
Add missing routes to test_app routes.
kevindecapite 3661893
Change JsonApiListener::_getSingleEntity() return to support entity v…
kevindecapite 0620078
Refactor tests per PHPUnit 10.5.5 upgrade.
kevindecapite 5df1c30
Fix PHPUnit 10 deprecations.
kevindecapite 80c215b
Remove psalm from GH workflow.
kevindecapite 5256734
Apply codesniffer checks & fixes; manual fixes as needed.
kevindecapite 23c8820
Fix phpstan issues.
kevindecapite 5c4ded2
composer require laravel-json-api/neomerx-json-api:^5.0.2
kevindecapite a9d937c
Fix type declaration breakages from codesniffer cleanup.
kevindecapite de4117b
composer require friendsofcake/crud:^7.2.0
kevindecapite 026e417
Use SelectQuery instead if Query in JsonApiListener.
kevindecapite 3108fbb
Re-use InstanceConfigTrait in JsonApiView to make getConfig() public …
kevindecapite eaff92b
Add _cake_core_ cache config to tests/bootstrap.php for BC.
kevindecapite fceb68a
Define many-to-many CountriesLanguages through model in test_app.
kevindecapite f6d94fb
Replace switch with match() in JsonApiListenerTest.
kevindecapite 7522a88
Rename plugin to CrudJsonApiPlugin.
kevindecapite d143d75
Remove ModelAwareTrait from JsonApiExceptionRendererTest.
kevindecapite a146267
Use fully qualified names where appropriate.
kevindecapite a0a1bee
Make entity return check sensible in JsonApiListener::_getSingleEntit…
kevindecapite df37bbc
Fix CS errors
ADmad a5f76b5
Fix phpstan errors
ADmad 7695d33
Fix CS errors
ADmad a67d5be
Update CI config
ADmad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,15 +10,15 @@ on: | |
|
||
jobs: | ||
testsuite: | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: [ '7.4', '8.0', '8.1' ] | ||
php-version: [ '8.1', '8.2', '8.3', '8.4' ] | ||
db-type: [ mysql ] | ||
prefer-lowest: [''] | ||
include: | ||
- php-version: '7.4' | ||
- php-version: '8.1' | ||
db-type: 'mysql' | ||
prefer-lowest: 'prefer-lowest' | ||
|
||
|
@@ -49,7 +49,7 @@ jobs: | |
run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }} | ||
|
@@ -62,35 +62,22 @@ jobs: | |
composer update | ||
fi | ||
|
||
- name: Configure PHPUnit matcher | ||
if: matrix.php-version == '7.4' && matrix.db-type == 'mysql' | ||
uses: mheap/phpunit-matcher-action@v1 | ||
|
||
- name: Run PHPUnit | ||
run: | | ||
if [[ ${{ matrix.db-type }} == 'mysql' && ${{ matrix.php-version }} != '7.2' ]]; then export DB_URL='mysql://root:[email protected]/cakephp?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"'; fi | ||
if [[ ${{ matrix.db-type }} == 'mysql' && ${{ matrix.php-version }} == '7.2' ]]; then export DB_URL='mysql://root:[email protected]/cakephp?encoding=utf8'; fi | ||
if [[ ${{ matrix.db-type }} == 'mysql' && ${{ matrix.php-version }} == '7.4' ]]; then | ||
vendor/bin/phpunit --coverage-clover=coverage.xml --verbose | ||
else | ||
vendor/bin/phpunit | ||
fi | ||
|
||
- name: Code Coverage Report | ||
if: success() && matrix.php-version == '7.4' && matrix.db-type == 'mysql' | ||
uses: codecov/codecov-action@v3 | ||
export DB_URL='mysql://root:[email protected]/cakephp?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"' | ||
vendor/bin/phpunit --display-incomplete --display-skipped --display-warnings --display-deprecations | ||
|
||
coding-standard: | ||
name: Coding Standard | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
php-version: '8.1' | ||
extensions: mbstring, intl, apcu | ||
coverage: none | ||
|
||
|
@@ -103,7 +90,7 @@ jobs: | |
run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }} | ||
|
@@ -116,15 +103,15 @@ jobs: | |
|
||
static-analysis: | ||
name: Static Analysis | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
php-version: '8.1' | ||
extensions: mbstring, intl, apcu | ||
coverage: none | ||
tools: cs2pr | ||
|
@@ -138,16 +125,13 @@ jobs: | |
run: echo "::set-output name=date::$(date +'%Y-%m')" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v1 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }} | ||
|
||
- name: composer install | ||
run: composer stan-setup | ||
|
||
- name: Run psalm | ||
run: vendor/bin/psalm.phar --output-format=github | ||
|
||
- name: Run phpstan | ||
run: vendor/bin/phpstan.phar analyse --error-format=checkstyle ./src | cs2pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ vendor/ | |
composer.lock | ||
tmp | ||
.phpunit.result.cache | ||
.phpunit.cache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
<?xml version="1.0"?> | ||
<phpunit | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="./tests/bootstrap.php"> | ||
|
||
<testsuites> | ||
<testsuite name="Crud"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<listeners> | ||
<listener class="\Cake\TestSuite\Fixture\FixtureInjector"> | ||
<arguments> | ||
<object class="\Cake\TestSuite\Fixture\FixtureManager" /> | ||
</arguments> | ||
</listener> | ||
</listeners> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
<directory suffix=".ctp">./src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
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.5/phpunit.xsd" | ||
cacheDirectory=".phpunit.cache" | ||
> | ||
<extensions> | ||
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/> | ||
</extensions> | ||
<testsuites> | ||
<testsuite name="Crud"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ok? It seems needed due to this change:
https://github.com/FriendsOfCake/crud/pull/754/files#diff-5aa78d26d9d06925cb6d1434c1c8afa3962704f1041ef3ecf1cb25561e66ee43L124