Skip to content

Commit b8ee5de

Browse files
authored
Merge pull request #733 from cakephp/issue-724
Port fixes from #716 to master
2 parents 2e0c6aa + 56e594b commit b8ee5de

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

src/Command/BenchmarkCommand.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
* functionally similar to Apache AB
2929
*
3030
* @since DebugKit 1.0
31-
* @todo Print/export time detail information
32-
* @todo Export/graphing of data to .dot format for graphviz visualization
33-
* @todo Make calculated results round to leading significant digit position of std dev.
3431
*/
3532
class BenchmarkCommand extends Command
3633
{

src/View/Helper/SimpleGraphHelper.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ class SimpleGraphHelper extends Helper
5555
public function bar($value, $offset, $options = [])
5656
{
5757
$settings = array_merge($this->_defaultSettings, $options);
58-
/** @var int $max */
59-
/** @var int $width */
60-
/** @var string $valueType */
61-
extract($settings);
58+
$max = $settings['max'];
59+
$width = $settings['width'];
60+
$valueType = $settings['valueType'];
6261

6362
$graphValue = $value / $max * $width;
6463
$graphValue = max(round($graphValue), 1);

tests/TestCase/DebugSqlTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
namespace DebugKit\Test\TestCase;
1616

17-
use Cake\Database\Driver\Mysql;
17+
use Cake\Database\Driver\Postgres;
1818
use Cake\Datasource\ConnectionManager;
1919
use Cake\ORM\TableRegistry;
2020
use Cake\TestSuite\TestCase;
@@ -59,7 +59,7 @@ public function testSqlText()
5959
###########################
6060
6161
EXPECTED;
62-
$fieldName = $this->connection->getDriver() instanceof Mysql ? '`panels__id`' : '"panels__id"';
62+
$fieldName = $this->connection->getDriver() instanceof Postgres ? '"panels__id"' : 'panels__id';
6363
$expected = sprintf($expectedText, str_replace(ROOT, '', __FILE__), __LINE__ - 11, $fieldName);
6464
$this->assertEquals($expected, $result);
6565
}
@@ -86,7 +86,7 @@ public function testSqlHtml()
8686
</pre>
8787
</div>
8888
EXPECTED;
89-
$fieldName = $this->connection->getDriver() instanceof Mysql ? '`panels__id`' : '"panels__id"';
89+
$fieldName = $this->connection->getDriver() instanceof Postgres ? '"panels__id"' : 'panels__id';
9090
$expected = sprintf($expectedHtml, str_replace(ROOT, '', __FILE__), __LINE__ - 15, $fieldName);
9191
$this->assertEquals(str_replace("\r", '', $expected), str_replace("\r", '', $result));
9292
}

tests/TestCase/Panel/VariablesPanelTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,14 @@ public function testShutdown()
112112
});
113113
$this->assertRegExp('/^\[stream\] Resource id #\d+$/', $output['content']['resource']);
114114
$this->assertIsArray($output['content']['unserializableDebugInfo']);
115+
116+
if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
117+
$expectedErrorMessage = "Unserializable object - stdClass. Error: Serialization of 'PDO' is not allowed";
118+
} else {
119+
$expectedErrorMessage = 'Unserializable object - stdClass. Error: You cannot serialize or unserialize PDO instances';
120+
}
115121
$this->assertStringStartsWith(
116-
'Unserializable object - stdClass. Error: You cannot serialize or unserialize PDO instances',
122+
$expectedErrorMessage,
117123
$output['content']['unserializableDebugInfo']['unserializable']
118124
);
119125
$this->assertStringStartsWith(

tests/TestCase/ToolbarServiceTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,7 @@ public function testInjectScriptsStreamBodies()
286286

287287
$result = $bar->injectScripts($row, $response);
288288
$this->assertInstanceOf('Cake\Http\Response', $result);
289-
if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
290-
$this->assertEquals('I am a teapot!', $response->getBody());
291-
} else {
292-
$this->assertInstanceOf('Closure', $response->getBody());
293-
}
289+
$this->assertEquals('I am a teapot!', $response->getBody());
294290
}
295291

296292
/**

0 commit comments

Comments
 (0)