Skip to content

Commit 476d396

Browse files
committed
fix tests
1 parent d9b6368 commit 476d396

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

tests/TestCase/ToolbarServiceTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Cake\TestSuite\TestCase;
2727
use DebugKit\Model\Entity\Request as RequestEntity;
2828
use DebugKit\Panel\SqlLogPanel;
29+
use DebugKit\TestApp\Panel\SimplePanel;
2930
use DebugKit\ToolbarService;
3031
use PHPUnit\Framework\Attributes\DataProvider;
3132

@@ -528,9 +529,10 @@ public function testSaveDataSerializationError()
528529
$bar->loadPanels();
529530

530531
// Create a panel with unserializable data
531-
$panel = $bar->registry()->load('DebugKit.TestApp\Panel\SimplePanel');
532+
/** @var SimplePanel $panel */
533+
$panel = $bar->registry()->load(SimplePanel::class);
532534
// Mock the data() method to return something problematic
533-
$panel->_data = ['closure' => fn () => 'test'];
535+
$panel->setData(['closure' => fn() => 'test']);
534536

535537
$row = $bar->saveData($request, $response);
536538
$this->assertNotEmpty($row, 'Should save data even with serialization errors');

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_' => [

tests/test_app/Panel/SimplePanel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@
2222
*/
2323
class SimplePanel extends DebugPanel
2424
{
25+
public function setData(array $data): void
26+
{
27+
$this->_data = $data;
28+
}
2529
}

0 commit comments

Comments
 (0)