Skip to content

Commit b622d37

Browse files
authored
Merge pull request #361 from FriendsOfCake/tests
Update tests.
2 parents 7dcf728 + 15755de commit b622d37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+268
-73
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ trim_trailing_whitespace = true
1414
[*.yml]
1515
indent_style = space
1616
indent_size = 2
17+
18+
[*.neon]
19+
indent_style = tab

.github/workflows/ci.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php-version: ['7.2', '7.4', '8.0']
17+
php-version: ['7.4', '8.0', '8.1']
1818
prefer-lowest: ['']
1919
include:
2020
- php-version: '7.2'
@@ -29,9 +29,7 @@ jobs:
2929
POSTGRES_PASSWORD: postgres
3030

3131
steps:
32-
- uses: actions/checkout@v1
33-
with:
34-
fetch-depth: 1
32+
- uses: actions/checkout@v2
3533

3634
- name: Setup PHP
3735
uses: shivammathur/setup-php@v2
@@ -62,24 +60,22 @@ jobs:
6260
6361
- name: Code Coverage Report
6462
if: matrix.php-version == '7.4'
65-
uses: codecov/codecov-action@v1
63+
uses: codecov/codecov-action@v2
6664

6765
cs-stan:
6866
name: Coding Standard & Static Analysis
6967
runs-on: ubuntu-18.04
7068

7169
steps:
72-
- uses: actions/checkout@v1
73-
with:
74-
fetch-depth: 1
70+
- uses: actions/checkout@v2
7571

7672
- name: Setup PHP
7773
uses: shivammathur/setup-php@v2
7874
with:
7975
php-version: '7.4'
8076
extensions: mbstring, intl
8177
coverage: none
82-
tools: cs2pr, psalm:^4.4, phpstan:^0.12
78+
tools: cs2pr, vimeo/psalm:4.21, phpstan:1.4
8379

8480
- name: Composer Install
8581
run: composer install

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"cakephp/cakephp": "^4.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "~8.5.0",
23+
"phpunit/phpunit": "^8.5 || ^9.3",
2424
"cakephp/bake": "^2.1",
2525
"cakephp/cakephp-codesniffer": "^4.1"
2626
},
@@ -48,7 +48,12 @@
4848
"cs-fix": "phpcbf --standard=vendor/cakephp/cakephp-codesniffer/CakePHP --ignore=comparisons src/ tests/",
4949
"stan": "phpstan analyse && psalm.phar",
5050
"psalm": "psalm.phar",
51-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 psalm/phar:^3.14 && mv composer.backup composer.json",
51+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.4 psalm/phar:^4.21 && mv composer.backup composer.json",
5252
"test": "phpunit"
53+
},
54+
"config": {
55+
"allow-plugins": {
56+
"dealerdirect/phpcodesniffer-composer-installer": true
57+
}
5358
}
5459
}

phpstan.neon

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
parameters:
2-
level: 7
3-
checkMissingIterableValueType: false
4-
bootstrapFiles:
5-
- tests/bootstrap.php
6-
paths:
7-
- src
8-
ignoreErrors:
9-
-
10-
message: "#^Offset 'element' does not exist on array\\('params' \\=\\> mixed\\)\\.$#"
11-
count: 1
12-
path: src/View/Helper/FlashHelper.php
2+
level: 7
3+
checkMissingIterableValueType: false
4+
bootstrapFiles:
5+
- tests/bootstrap.php
6+
paths:
7+
- src
8+
ignoreErrors:
9+
-
10+
message: "#^Parameter \\#1 \\$options of method Cake\\\\View\\\\StringTemplate\\:\\:formatAttributes\\(\\) expects array\\<string, mixed\\>\\|null, array given\\.$#"
11+
count: 1
12+
path: src/View/Helper/FormHelper.php

src/View/Helper/FlashHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class FlashHelper extends Helper
1616
* - class: List of classes to be applied to the div containing message
1717
* - attributes: Additional attributes for the div containing message
1818
*
19-
* @var array
19+
* @var array<string, mixed>
2020
*/
2121
protected $_defaultConfig = [
2222
'class' => ['alert', 'alert-dismissible', 'fade', 'show'],
@@ -57,6 +57,7 @@ public function render(string $key = 'flash', array $options = []): ?string
5757

5858
$out = '';
5959
foreach ($stack as $message) {
60+
/** @var array<string, mixed> $message */
6061
$message = $options + $message;
6162
$message['params'] += $this->_config;
6263
$this->getView()->getRequest()->getSession()->delete("Flash.$key");

0 commit comments

Comments
 (0)