Skip to content

Commit b5c5b07

Browse files
committed
PHPUnit 12 upgrade
1 parent 80082f4 commit b5c5b07

29 files changed

Lines changed: 62 additions & 85 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: [3.x, 4.x, 5.x, 6.x]
5+
branches: [6.x]
66
pull_request:
77
branches: ['*']
88
workflow_dispatch:
@@ -13,10 +13,10 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-version: ['8.2', '8.3', '8.4']
16+
php-version: ['8.3', '8.4', '8.5']
1717
prefer-lowest: ['']
1818
include:
19-
- php-version: '8.2'
19+
- php-version: '8.3'
2020
prefer-lowest: 'prefer-lowest'
2121

2222
steps:
@@ -52,20 +52,20 @@ jobs:
5252
fi
5353
5454
- name: Setup problem matchers for PHPUnit
55-
if: matrix.php-version == '8.2'
55+
if: matrix.php-version == '8.3'
5656
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
5757

5858
- name: Run PHPUnit
5959
run: |
60-
if [[ "${{ matrix.php-version }}" == "8.2" && "${{ matrix.prefer-lowest }}" != "prefer-lowest" ]]; then
60+
if [[ "${{ matrix.php-version }}" == "8.3" && "${{ matrix.prefer-lowest }}" != "prefer-lowest" ]]; then
6161
export CODECOVERAGE=1
6262
vendor/bin/phpunit --display-incomplete --display-skipped --coverage-clover=coverage.xml
6363
else
6464
vendor/bin/phpunit
6565
fi
6666
6767
- name: Submit code coverage
68-
if: matrix.php-version == '8.2' && matrix.prefer-lowest != 'prefer-lowest'
68+
if: matrix.php-version == '8.3' && matrix.prefer-lowest != 'prefer-lowest'
6969
uses: codecov/codecov-action@v5
7070

7171
cs-stan:
@@ -78,7 +78,7 @@ jobs:
7878
- name: Setup PHP
7979
uses: shivammathur/setup-php@v2
8080
with:
81-
php-version: '8.2'
81+
php-version: '8.3'
8282
extensions: mbstring, intl
8383
tools: cs2pr
8484
coverage: none

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
DEV_DEPENDENCIES = cakephp/cakephp:5.x-dev \
44
cakephp/cakephp-codesniffer:^5.0 \
55
mikey179/vfsstream:^1.6.8 \
6-
phpunit/phpunit:^10.5.38 \
6+
phpunit/phpunit:^12.1.3 \
77
cakephp/migrations:^5.0.0
88

99
install-dev:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"setup": "cp composer.json composer.backup && make install-dev && mv composer.backup composer.json",
3232
"cs-check": "phpcs",
3333
"cs-fix": "phpcbf",
34-
"test": "phpunit"
34+
"test": "phpunit --display-all-issues"
3535
},
3636
"config": {
3737
"sort-packages": true,

tests/TestCase/Command/LinterCommandTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public function testLinterSuccess()
5151
*/
5252
public function testLinterFail()
5353
{
54-
mkdir(TMP . 'linter', 0777, true);
54+
if (!file_exists(TMP . 'linter')) {
55+
mkdir(TMP . 'linter', 0777, true);
56+
}
5557
file_put_contents(TMP . 'linter/BrokenExample.php', '<?php class X }');
5658
$this->exec('linter tmp/linter/ -v');
5759

tests/TestCase/Rector/ClassMethod/FormBuildValidatorRector/FormBuildValidatorRectorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
namespace Cake\Upgrade\Test\TestCase\Rector\ClassMethod\FormBuildValidatorRector;
55

66
use Iterator;
7+
use PHPUnit\Framework\Attributes\DataProvider;
78
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
89

910
final class FormBuildValidatorRectorTest extends AbstractRectorTestCase
1011
{
11-
/**
12-
* @dataProvider provideData()
13-
*/
12+
#[DataProvider('provideData')]
1413
public function test(string $filePath): void
1514
{
1615
$this->doTestFile($filePath);

tests/TestCase/Rector/ClassMethod/FormExecuteToProcessRector/FormExecuteToProcessRectorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
namespace Cake\Upgrade\Test\TestCase\Rector\ClassMethod\FormExecuteToProcessRector;
55

66
use Iterator;
7+
use PHPUnit\Framework\Attributes\DataProvider;
78
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
89

910
final class FormExecuteToProcessRectorTest extends AbstractRectorTestCase
1011
{
11-
/**
12-
* @dataProvider provideData()
13-
*/
12+
#[DataProvider('provideData')]
1413
public function test(string $filePath): void
1514
{
1615
$this->doTestFile($filePath);

tests/TestCase/Rector/MethodCall/AddMethodCallArgsRector/AddMethodCallArgsRectorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\AddMethodCallArgsRector;
55

66
use Iterator;
7+
use PHPUnit\Framework\Attributes\DataProvider;
78
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
89

910
final class AddMethodCallArgsRectorTest extends AbstractRectorTestCase
1011
{
11-
/**
12-
* @dataProvider provideData()
13-
*/
12+
#[DataProvider('provideData')]
1413
public function test(string $filePath): void
1514
{
1615
$this->doTestFile($filePath);

tests/TestCase/Rector/MethodCall/ArrayToFluentCallRector/ArrayToFluentCallRectorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\ArrayToFluentCallRector;
66

77
use Iterator;
8+
use PHPUnit\Framework\Attributes\DataProvider;
89
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
910

1011
final class ArrayToFluentCallRectorTest extends AbstractRectorTestCase
1112
{
12-
/**
13-
* @dataProvider provideData()
14-
*/
13+
#[DataProvider('provideData')]
1514
public function test(string $filePath): void
1615
{
1716
$this->doTestFile($filePath);

tests/TestCase/Rector/MethodCall/BinaryColumnToVarbinaryRector/BinaryColumnToVarbinaryRectorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\BinaryColumnToVarbinaryRector;
55

66
use Iterator;
7+
use PHPUnit\Framework\Attributes\DataProvider;
78
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
89

910
final class BinaryColumnToVarbinaryRectorTest extends AbstractRectorTestCase
1011
{
11-
/**
12-
* @dataProvider provideData()
13-
*/
12+
#[DataProvider('provideData')]
1413
public function test(string $filePath): void
1514
{
1615
$this->doTestFile($filePath);

tests/TestCase/Rector/MethodCall/BreadcrumbsHelperAddManyRector/BreadcrumbsHelperAddManyRectorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
namespace Cake\Upgrade\Test\TestCase\Rector\MethodCall\BreadcrumbsHelperAddManyRector;
55

66
use Iterator;
7+
use PHPUnit\Framework\Attributes\DataProvider;
78
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
89

910
final class BreadcrumbsHelperAddManyRectorTest extends AbstractRectorTestCase
1011
{
11-
/**
12-
* @dataProvider provideData()
13-
*/
12+
#[DataProvider('provideData')]
1413
public function test(string $filePath): void
1514
{
1615
$this->doTestFile($filePath);

0 commit comments

Comments
 (0)