diff --git a/.phive/phars.xml b/.phive/phars.xml index f5aa3300..a95d33f9 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,4 +1,4 @@ - + diff --git a/composer.json b/composer.json index c2d51114..15d82c07 100644 --- a/composer.json +++ b/composer.json @@ -30,13 +30,13 @@ "require": { "php": ">=8.1", "cakephp/cakephp": "^5.1", - "composer/composer": "^2.0", + "composer/composer": "^2.7.7", "doctrine/sql-formatter": "^1.1.3" }, "require-dev": { "cakephp/authorization": "^3.0", "cakephp/cakephp-codesniffer": "^5.0", - "phpunit/phpunit": "^10.5.5 || ^11.1.3" + "phpunit/phpunit": "^10.5.32 || ^11.1.3 || ^12.0.9" }, "suggest": { "ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." diff --git a/tests/TestCase/Middleware/DebugKitMiddlewareTest.php b/tests/TestCase/Middleware/DebugKitMiddlewareTest.php index 79bcfeb7..6a15a18f 100644 --- a/tests/TestCase/Middleware/DebugKitMiddlewareTest.php +++ b/tests/TestCase/Middleware/DebugKitMiddlewareTest.php @@ -193,13 +193,13 @@ public function testInvokeNoModifyBinaryResponse() $handler = $this->handler(); $handler->expects($this->once()) ->method('handle') - ->will($this->returnCallback(function ($req) use ($response) { + ->willReturnCallback(function ($req) use ($response) { $stream = new CallbackStream(function () { return 'hi!'; }); return $response->withBody($stream); - })); + }); $middleware = new DebugKitMiddleware(); $result = $middleware->process($request, $handler); $this->assertInstanceOf(Response::class, $result, 'Should return a response'); diff --git a/tests/TestCase/Model/Table/RequestTableTest.php b/tests/TestCase/Model/Table/RequestTableTest.php index 021a710b..8fb02690 100644 --- a/tests/TestCase/Model/Table/RequestTableTest.php +++ b/tests/TestCase/Model/Table/RequestTableTest.php @@ -84,7 +84,7 @@ public function testGc() /** @var \PHPUnit\Framework\MockObject\MockObject&\DebugKit\Model\Table\RequestsTable $requestsTableMock */ $requestsTableMock = $this->getMockForModel('DebugKit.Requests', ['shouldGc']); $requestsTableMock->method('shouldGc') - ->will($this->returnValue(true)); + ->willReturn(true); $data = array_fill(0, 10, [ 'url' => '/tasks/add', diff --git a/tests/TestCase/Panel/IncludePanelTest.php b/tests/TestCase/Panel/IncludePanelTest.php index aa066873..776abb62 100644 --- a/tests/TestCase/Panel/IncludePanelTest.php +++ b/tests/TestCase/Panel/IncludePanelTest.php @@ -17,6 +17,7 @@ use Cake\Event\Event; use Cake\TestSuite\TestCase; use DebugKit\Panel\IncludePanel; +use PHPUnit\Framework\Attributes\WithoutErrorHandler; /** * Class IncludePanelTest @@ -36,7 +37,9 @@ class IncludePanelTest extends TestCase public function setUp(): void { parent::setUp(); - $this->panel = new IncludePanel(); + $this->deprecated(function () { + $this->panel = new IncludePanel(); + }); } /** @@ -44,6 +47,7 @@ public function setUp(): void * * @return void */ + #[WithoutErrorHandler] public function testShutdown() { $this->panel->shutdown(new Event('Controller.shutdown')); @@ -61,6 +65,7 @@ public function testShutdown() * * @return void */ + #[WithoutErrorHandler] public function testSummary() { $total = $this->panel->summary(); diff --git a/tests/TestCase/Panel/SessionPanelTest.php b/tests/TestCase/Panel/SessionPanelTest.php index 4970de02..8341f4a1 100644 --- a/tests/TestCase/Panel/SessionPanelTest.php +++ b/tests/TestCase/Panel/SessionPanelTest.php @@ -20,6 +20,7 @@ use Cake\Http\Session; use Cake\TestSuite\TestCase; use DebugKit\Panel\SessionPanel; +use PHPUnit\Framework\Attributes\WithoutErrorHandler; /** * Class RequestPanelTest @@ -47,6 +48,7 @@ public function setUp(): void * * @return void */ + #[WithoutErrorHandler] public function testShutdownSkipAttributes() { $session = new Session(); @@ -57,7 +59,9 @@ public function testShutdownSkipAttributes() $controller = new Controller($request); $event = new Event('Controller.shutdown', $controller); - $this->panel->shutdown($event); + $this->deprecated(function () use ($event) { + $this->panel->shutdown($event); + }); $data = $this->panel->data(); $this->assertArrayHasKey('content', $data); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 1f605002..e43e2036 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -71,9 +71,9 @@ ]); Cache::setConfig([ - '_cake_core_' => [ + '_cake_translations_' => [ 'engine' => 'File', - 'prefix' => 'cake_core_', + 'prefix' => 'cake_translations_', 'serialize' => true, ], '_cake_model_' => [