Skip to content

Commit 76e4e56

Browse files
committed
Update phpunit config and app for CakePHP v5.x
1 parent f148561 commit 76e4e56

5 files changed

Lines changed: 27 additions & 30 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/composer.phar
33
/phpunit.xml
44
/.phpunit.result.cache
5+
/.phpunit.cache
56
/phpunit.phar
67
/config/Migrations/schema-dump-default.lock
78
/vendor/

phpunit.xml.dist

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
colors="true"
5-
processIsolation="false"
6-
stopOnFailure="false"
7-
bootstrap="tests/bootstrap.php"
8-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
9-
>
10-
<coverage>
11-
<include>
12-
<directory suffix=".php">src/</directory>
13-
</include>
14-
</coverage>
15-
<php>
16-
<ini name="memory_limit" value="-1"/>
17-
<ini name="apc.enable_cli" value="1"/>
18-
</php>
19-
<!-- Add any additional test suites you want to run here -->
20-
<testsuites>
21-
<testsuite name="SvgIcon">
22-
<directory>tests/TestCase/</directory>
23-
</testsuite>
24-
</testsuites>
25-
<!-- Setup fixture extension -->
26-
<extensions>
27-
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
28-
</extensions>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
colors="true"
4+
processIsolation="false"
5+
stopOnFailure="false"
6+
bootstrap="tests/bootstrap.php"
7+
cacheDirectory=".phpunit.cache"
8+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd">
9+
<php>
10+
<ini name="memory_limit" value="-1"/>
11+
<ini name="apc.enable_cli" value="1"/>
12+
</php>
13+
14+
<!-- Add any additional test suites you want to run here -->
15+
<testsuites>
16+
<testsuite name="app">
17+
<directory>tests/TestCase/</directory>
18+
</testsuite>
19+
</testsuites>
20+
21+
<!-- Load extension for fixtures -->
22+
<extensions>
23+
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
24+
</extensions>
2925
</phpunit>

src/View/Helper/SvgIconHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SvgIconHelper extends Helper
1919
*
2020
* @var array<string, mixed>
2121
*/
22-
protected $_defaultConfig = [];
22+
protected array $_defaultConfig = [];
2323

2424
/**
2525
* Icon getter and modifier (if $options exist).

tests/TestCase/Lib/SvgIconTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testGet($name, $options, $expected): void
5555
*
5656
* @return array
5757
*/
58-
public function provideGet(): array
58+
public static function provideGet(): array
5959
{
6060
return SvgIconTraitTest::getProvider();
6161
}

tests/TestCase/View/Helper/SvgIconHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testGet($name, $options, $expected): void
6868
*
6969
* @return array
7070
*/
71-
public function provideGet(): array
71+
public static function provideGet(): array
7272
{
7373
return SvgIconTraitTest::getProvider();
7474
}

0 commit comments

Comments
 (0)