Skip to content

Commit c03f141

Browse files
committed
Preparing 3.0 release
Improved tryTo steps Improved output for failed tests
1 parent 5cc325d commit c03f141

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Codeception/Module/REST.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,19 @@ public function _inject(InnerBrowser $connection)
136136
}
137137
}
138138

139+
public function _failed(TestInterface $test, $fail)
140+
{
141+
if (!$this->response) {
142+
return;
143+
}
144+
$printedResponse = $this->response;
145+
if ($this->isBinaryData($printedResponse)) {
146+
$printedResponse = $this->binaryToDebugString($printedResponse);
147+
}
148+
$test->getMetadata()->addReport('body', $printedResponse);
149+
}
150+
151+
139152
protected function getRunningClient()
140153
{
141154
if ($this->client->getInternalRequest() === null) {

0 commit comments

Comments
 (0)