Skip to content

Commit ec8e029

Browse files
authored
Merge pull request #1053 from cakephp/5.next-cleanup
update stan & cleanup tests
2 parents 2314ece + 4411fda commit ec8e029

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

.phive/phars.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpstan" version="2.1.17" installed="2.1.17" location="./tools/phpstan" copy="false"/>
3+
<phar name="phpstan" version="2.1.31" installed="2.1.31" location="./tools/phpstan" copy="false"/>
44
</phive>

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
"require": {
3131
"php": ">=8.1",
3232
"cakephp/cakephp": "^5.1",
33-
"composer/composer": "^2.0",
33+
"composer/composer": "^2.7.7",
3434
"doctrine/sql-formatter": "^1.1.3"
3535
},
3636
"require-dev": {
3737
"cakephp/authorization": "^3.0",
3838
"cakephp/cakephp-codesniffer": "^5.0",
39-
"phpunit/phpunit": "^10.5.5 || ^11.1.3"
39+
"phpunit/phpunit": "^10.5.32 || ^11.1.3 || ^12.0.9"
4040
},
4141
"suggest": {
4242
"ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use."

tests/TestCase/Middleware/DebugKitMiddlewareTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ public function testInvokeNoModifyBinaryResponse()
193193
$handler = $this->handler();
194194
$handler->expects($this->once())
195195
->method('handle')
196-
->will($this->returnCallback(function ($req) use ($response) {
196+
->willReturnCallback(function ($req) use ($response) {
197197
$stream = new CallbackStream(function () {
198198
return 'hi!';
199199
});
200200

201201
return $response->withBody($stream);
202-
}));
202+
});
203203
$middleware = new DebugKitMiddleware();
204204
$result = $middleware->process($request, $handler);
205205
$this->assertInstanceOf(Response::class, $result, 'Should return a response');

tests/TestCase/Model/Table/RequestTableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testGc()
8484
/** @var \PHPUnit\Framework\MockObject\MockObject&\DebugKit\Model\Table\RequestsTable $requestsTableMock */
8585
$requestsTableMock = $this->getMockForModel('DebugKit.Requests', ['shouldGc']);
8686
$requestsTableMock->method('shouldGc')
87-
->will($this->returnValue(true));
87+
->willReturn(true);
8888

8989
$data = array_fill(0, 10, [
9090
'url' => '/tasks/add',

tests/TestCase/Panel/IncludePanelTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Cake\Event\Event;
1818
use Cake\TestSuite\TestCase;
1919
use DebugKit\Panel\IncludePanel;
20+
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
2021

2122
/**
2223
* Class IncludePanelTest
@@ -36,14 +37,17 @@ class IncludePanelTest extends TestCase
3637
public function setUp(): void
3738
{
3839
parent::setUp();
39-
$this->panel = new IncludePanel();
40+
$this->deprecated(function () {
41+
$this->panel = new IncludePanel();
42+
});
4043
}
4144

4245
/**
4346
* test shutdown
4447
*
4548
* @return void
4649
*/
50+
#[WithoutErrorHandler]
4751
public function testShutdown()
4852
{
4953
$this->panel->shutdown(new Event('Controller.shutdown'));
@@ -61,6 +65,7 @@ public function testShutdown()
6165
*
6266
* @return void
6367
*/
68+
#[WithoutErrorHandler]
6469
public function testSummary()
6570
{
6671
$total = $this->panel->summary();

tests/TestCase/Panel/SessionPanelTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Cake\Http\Session;
2121
use Cake\TestSuite\TestCase;
2222
use DebugKit\Panel\SessionPanel;
23+
use PHPUnit\Framework\Attributes\WithoutErrorHandler;
2324

2425
/**
2526
* Class RequestPanelTest
@@ -47,6 +48,7 @@ public function setUp(): void
4748
*
4849
* @return void
4950
*/
51+
#[WithoutErrorHandler]
5052
public function testShutdownSkipAttributes()
5153
{
5254
$session = new Session();
@@ -57,7 +59,9 @@ public function testShutdownSkipAttributes()
5759

5860
$controller = new Controller($request);
5961
$event = new Event('Controller.shutdown', $controller);
60-
$this->panel->shutdown($event);
62+
$this->deprecated(function () use ($event) {
63+
$this->panel->shutdown($event);
64+
});
6165

6266
$data = $this->panel->data();
6367
$this->assertArrayHasKey('content', $data);

tests/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
]);
7272

7373
Cache::setConfig([
74-
'_cake_core_' => [
74+
'_cake_translations_' => [
7575
'engine' => 'File',
76-
'prefix' => 'cake_core_',
76+
'prefix' => 'cake_translations_',
7777
'serialize' => true,
7878
],
7979
'_cake_model_' => [

0 commit comments

Comments
 (0)