Skip to content

Commit 7b325f8

Browse files
committed
fix other tests
1 parent 0b4b6b7 commit 7b325f8

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/Panel/PluginsPanel.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public function initialize(): void
5353
*/
5454
public function summary(): string
5555
{
56+
if (!isset($this->_data['plugins'])) {
57+
return '0';
58+
}
59+
5660
return (string)count($this->_data['plugins']);
5761
}
5862
}

tests/TestCase/Middleware/DebugKitMiddlewareTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ public function testInvokeSaveData()
121121
$this->assertSame(200, $result->status_code);
122122
$this->assertGreaterThan(1, $result->panels);
123123

124-
$this->assertSame('SqlLog', $result->panels[11]->panel);
125-
$this->assertSame('DebugKit.sql_log_panel', $result->panels[11]->element);
126-
$this->assertNotNull($result->panels[11]->summary);
127-
$this->assertSame('Sql Log', $result->panels[11]->title);
124+
$this->assertSame('SqlLog', $result->panels[12]->panel);
125+
$this->assertSame('DebugKit.sql_log_panel', $result->panels[12]->element);
126+
$this->assertNotNull($result->panels[12]->summary);
127+
$this->assertSame('Sql Log', $result->panels[12]->title);
128128

129129
$timeStamp = filectime(Plugin::path('DebugKit') . 'webroot' . DS . 'js' . DS . 'main.js');
130130

tests/TestCase/ToolbarServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ public function testSaveData()
250250
$this->assertSame(200, $result->status_code);
251251
$this->assertGreaterThan(1, $result->panels);
252252

253-
$this->assertSame('SqlLog', $result->panels[11]->panel);
254-
$this->assertSame('DebugKit.sql_log_panel', $result->panels[11]->element);
255-
$this->assertSame('0', $result->panels[11]->summary);
256-
$this->assertSame('Sql Log', $result->panels[11]->title);
253+
$this->assertSame('SqlLog', $result->panels[12]->panel);
254+
$this->assertSame('DebugKit.sql_log_panel', $result->panels[12]->element);
255+
$this->assertSame('0', $result->panels[12]->summary);
256+
$this->assertSame('Sql Log', $result->panels[12]->title);
257257
}
258258

259259
/**

0 commit comments

Comments
 (0)