Skip to content

Commit

Permalink
Update phpunit config and app for CakePHP v5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
chronon committed Feb 11, 2024
1 parent f148561 commit 76e4e56
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/composer.phar
/phpunit.xml
/.phpunit.result.cache
/.phpunit.cache
/phpunit.phar
/config/Migrations/schema-dump-default.lock
/vendor/
Expand Down
50 changes: 23 additions & 27 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
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/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>
<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="SvgIcon">
<directory>tests/TestCase/</directory>
</testsuite>
</testsuites>
<!-- Setup fixture extension -->
<extensions>
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
</extensions>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd">
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="app">
<directory>tests/TestCase/</directory>
</testsuite>
</testsuites>

<!-- Load extension for fixtures -->
<extensions>
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
</extensions>
</phpunit>
2 changes: 1 addition & 1 deletion src/View/Helper/SvgIconHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SvgIconHelper extends Helper
*
* @var array<string, mixed>
*/
protected $_defaultConfig = [];
protected array $_defaultConfig = [];

/**
* Icon getter and modifier (if $options exist).
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Lib/SvgIconTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testGet($name, $options, $expected): void
*
* @return array
*/
public function provideGet(): array
public static function provideGet(): array
{
return SvgIconTraitTest::getProvider();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/Helper/SvgIconHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testGet($name, $options, $expected): void
*
* @return array
*/
public function provideGet(): array
public static function provideGet(): array
{
return SvgIconTraitTest::getProvider();
}
Expand Down

0 comments on commit 76e4e56

Please sign in to comment.