Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
The Cake core's exception name has changed in 4.2.
  • Loading branch information
ADmad committed Feb 24, 2021
1 parent df38dcc commit 83a3157
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4']
php-version: ['7.2', '7.4', '8.0']
db-type: [sqlite, mysql, pgsql]
name: PHP ${{ matrix.php-version }} & ${{ matrix.db-type }}

Expand All @@ -32,10 +32,10 @@ jobs:
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extension-csv: mbstring, intl, pdo_${{ matrix.db-type }}
extensions: mbstring, intl, pdo_${{ matrix.db-type }}
coverage: pcov
pecl: false

Expand Down Expand Up @@ -68,10 +68,10 @@ jobs:
fetch-depth: 1

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extension-csv: mbstring, intl
extensios: mbstring, intl
coverage: none
pecl: false

Expand All @@ -82,7 +82,9 @@ jobs:
run: vendor/bin/phpcs --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/

- name: Run psalm
if: failure() || success()
run: vendor/bin/psalm.phar --output-format=github

- name: Run phpstan
if: failure() || success()
run: vendor/bin/phpstan.phar analyse --error-format=github
16 changes: 8 additions & 8 deletions tests/TestCase/Error/ExceptionRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public function testNormalExceptionRendering()
'url' => $Controller->getRequest()->getRequestTarget(),
'message' => 'Hello World',
'exception' => [
'class' => 'Cake\Core\Exception\Exception',
'code' => 500,
'class' => 'Cake\Core\Exception\CakeException',
'code' => 0,
'message' => 'Hello World',
],
];
Expand Down Expand Up @@ -135,8 +135,8 @@ public function testNormalExceptionRenderingQueryLog()
'url' => $Controller->getRequest()->getRequestTarget(),
'message' => 'Hello World',
'exception' => [
'class' => 'Cake\Core\Exception\Exception',
'code' => 500,
'class' => 'Cake\Core\Exception\CakeException',
'code' => 0,
'message' => 'Hello World',
],
];
Expand Down Expand Up @@ -205,8 +205,8 @@ public function testNormalNestedExceptionRendering()
'url' => $Controller->getRequest()->getRequestTarget(),
'message' => 'Hello World',
'exception' => [
'class' => 'Cake\Core\Exception\Exception',
'code' => 500,
'class' => 'Cake\Core\Exception\CakeException',
'code' => 0,
'message' => 'Hello World',
],
];
Expand Down Expand Up @@ -269,8 +269,8 @@ public function testMissingViewExceptionDuringRendering()
'url' => $Controller->getRequest()->getRequestTarget(),
'message' => 'Hello World',
'exception' => [
'class' => 'Cake\Core\Exception\Exception',
'code' => 500,
'class' => 'Cake\Core\Exception\CakeException',
'code' => 0,
'message' => 'Hello World',
],
];
Expand Down

0 comments on commit 83a3157

Please sign in to comment.