Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Jun 18, 2022
1 parent 2d3f964 commit 113d2e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/TestCase/Middleware/DebugKitMiddlewareTest.php
Expand Up @@ -119,11 +119,11 @@ public function testInvokeSaveData()
$this->assertNotNull($result->panels[11]->summary);
$this->assertSame('Sql Log', $result->panels[11]->title);

$timeStamp = filemtime(Plugin::path('DebugKit') . 'webroot' . DS . 'js' . DS . 'toolbar.js');
$timeStamp = filemtime(Plugin::path('DebugKit') . 'webroot' . DS . 'js' . DS . 'main.js');

$expected = '<html><title>test</title><body><p>some text</p>' .
'<script id="__debug_kit" data-id="' . $result->id . '" ' .
'data-url="http://localhost/" src="/debug_kit/js/toolbar.js?' . $timeStamp . '"></script>' .
'<script id="__debug_kit_script" data-id="' . $result->id . '" ' .
'data-url="http://localhost/" type="module" src="/debug_kit/js/inject-iframe.js?' . $timeStamp . '"></script>' .
'</body>';
$body = (string)$response->getBody();
$this->assertTextEquals($expected, $body);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/ToolbarServiceTest.php
Expand Up @@ -302,11 +302,11 @@ public function testInjectScriptsLastBodyTag()
$row = $bar->saveData($request, $response);
$response = $bar->injectScripts($row, $response);

$timeStamp = filemtime(Plugin::path('DebugKit') . 'webroot' . DS . 'js' . DS . 'toolbar.js');
$timeStamp = filemtime(Plugin::path('DebugKit') . 'webroot' . DS . 'js' . DS . 'main.js');

$expected = '<html><title>test</title><body><p>some text</p>' .
'<script id="__debug_kit" data-id="' . $row->id . '" ' .
'data-url="http://localhost/" src="/debug_kit/js/toolbar.js?' . $timeStamp . '"></script>' .
'<script id="__debug_kit_script" data-id="' . $row->id . '" ' .
'data-url="http://localhost/" type="module" src="/debug_kit/js/inject-iframe.js?' . $timeStamp . '"></script>' .
'</body>';
$this->assertTextEquals($expected, (string)$response->getBody());
$this->assertTrue($response->hasHeader('X-DEBUGKIT-ID'), 'Should have a tracking id');
Expand Down

0 comments on commit 113d2e0

Please sign in to comment.