Skip to content

Commit 5f6b059

Browse files
committed
Fix tests
1 parent 6af00f0 commit 5f6b059

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

tests/TestCase/Panel/VariablesPanelTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ public function testShutdown()
107107
});
108108
$this->assertRegExp('/^\[stream\] Resource id #\d+$/', $output['content']['resource']);
109109
$this->assertInternalType('array', $output['content']['unserializableDebugInfo']);
110+
if (version_compare(PHP_VERSION, '7.4.0', '>=')) {
111+
$expectedErrorMessage = "Unserializable object - stdClass. Error: Serialization of 'PDO' is not allowed";
112+
} else {
113+
$expectedErrorMessage = 'Unserializable object - stdClass. Error: You cannot serialize or unserialize PDO instances';
114+
}
110115
$this->assertStringStartsWith(
111-
'Unserializable object - stdClass. Error: You cannot serialize or unserialize PDO instances',
116+
$expectedErrorMessage,
112117
$output['content']['unserializableDebugInfo']['unserializable']
113118
);
114119
$this->assertStringStartsWith(

tests/TestCase/Routing/Filter/DebugBarFilterTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@ public function testAfterDispatchIgnoreStreamBodies()
135135
$bar = new DebugBarFilter($this->events, []);
136136
$event = new Event('Dispatcher.afterDispatch', $bar, compact('request', 'response'));
137137
$bar->afterDispatch($event);
138-
if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
139-
$this->assertEquals('I am a teapot!', $response->getBody());
140-
} else {
141-
$this->assertInstanceOf('Closure', $response->getBody());
142-
}
138+
$this->assertEquals('I am a teapot!', $response->getBody());
143139
}
144140

145141
/**

tests/TestCase/ToolbarServiceTest.php

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

307307
$result = $bar->injectScripts($row, $response);
308308
$this->assertInstanceOf('Cake\Http\Response', $result);
309-
if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
310-
$this->assertEquals('I am a teapot!', $response->getBody());
311-
} else {
312-
$this->assertInstanceOf('Closure', $response->getBody());
313-
}
309+
$this->assertEquals('I am a teapot!', $response->getBody());
314310
}
315311

316312
/**

0 commit comments

Comments
 (0)