Skip to content

Commit 303811a

Browse files
authored
Update phpunit (#112)
* Update phpunit * Add cache profile for old cakephp * Fix test failing when run in isolation
1 parent 77e0f81 commit 303811a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"cakephp/debug_kit": "^5.0",
3333
"michelf/php-markdown": "^1.9",
3434
"mikey179/vfsstream": "^1.6.10",
35-
"phpunit/phpunit": "^10.5.5 || ^11.1.3"
35+
"phpunit/phpunit": "^11.5.3 | ^12.1.3"
3636
},
3737
"conflict": {
3838
"wyrihaximus/twig-view": "*"

tests/TestCase/Twig/FileLoaderTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
namespace Cake\TwigView\Test\TestCase\Twig;
2020

21+
use Cake\Routing\Router;
2122
use Cake\TestSuite\TestCase;
2223
use Cake\TwigView\Twig\FileLoader;
2324
use Twig\Error\LoaderError;
@@ -36,6 +37,7 @@ public function setUp(): void
3637
{
3738
parent::setUp();
3839

40+
Router::reload();
3941
$this->loadPlugins(['TestTwigView']);
4042

4143
$this->loader = new FileLoader(['.twig']);
@@ -81,7 +83,7 @@ public function testGetCacheKeyPluginNonExistingFile()
8183

8284
public function testIsFresh()
8385
{
84-
file_put_contents(TMP . 'TwigViewIsFreshTest', 'TwigViewIsFreshTest');
86+
file_put_contents(TMP . 'TwigViewIsFreshTest', 'is fresh test');
8587
$time = filemtime(TMP . 'TwigViewIsFreshTest');
8688

8789
$this->assertTrue($this->loader->isFresh(TMP . 'TwigViewIsFreshTest', $time + 5));

tests/bootstrap.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@
5858
'default' => [
5959
'engine' => 'File',
6060
],
61+
'_cake_core_' => [
62+
'className' => 'File',
63+
'prefix' => '_cake_translations_',
64+
'path' => CACHE . 'persistent/',
65+
'serialize' => true,
66+
'duration' => '+10 seconds',
67+
],
6168
'_cake_translations_' => [
6269
'className' => 'File',
6370
'prefix' => '_cake_translations_',

0 commit comments

Comments
 (0)