Skip to content

Commit 9cd7a87

Browse files
committed
added check for json
1 parent 14e638e commit 9cd7a87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Codeception/Step/AsJson.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public function run(ModuleContainer $container = null)
1111
{
1212
$container->getModule('REST')->haveHttpHeader('Content-Type', 'application/json');
1313
$resp = parent::run($container);
14+
$container->getModule('REST')->seeResponseIsJson();
1415
return json_decode($resp, true);
1516
}
1617

@@ -21,7 +22,7 @@ public static function getTemplate(Template $template)
2122
// should only be applied to send* methods
2223
if (strpos($action, 'send') !== 0) return;
2324

24-
$conditionalDoc = "* JSON response will be automatically decoded \n " . $template->getVar('doc');
25+
$conditionalDoc = "* JSON response will be automatically decoded \n " . $template->getVar('doc');
2526

2627
return $template
2728
->place('doc', $conditionalDoc)

0 commit comments

Comments
 (0)