Skip to content

Commit f9fa3b9

Browse files
johannesschobelDavertMik
authored andcommitted
new REST / InnerBrowser Asserts (#5030)
* new assertions to assert "ranges" of status-codes (e.g., if it is a client-error --> 4xx) * add missing test
1 parent c9af74e commit f9fa3b9

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/Codeception/Module/REST.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,39 @@ public function dontSeeResponseCodeIs($code)
11611161
$this->connectionModule->dontSeeResponseCodeIs($code);
11621162
}
11631163

1164+
/**
1165+
* Checks that the response code is 2xx
1166+
*/
1167+
public function seeResponseCodeIsSuccessful()
1168+
{
1169+
$this->connectionModule->seeResponseCodeIsSuccessful();
1170+
}
1171+
1172+
/**
1173+
* Checks that the response code 3xx
1174+
*/
1175+
public function seeResponseCodeIsRedirection()
1176+
{
1177+
$this->connectionModule->seeResponseCodeIsRedirection();
1178+
}
1179+
1180+
/**
1181+
* Checks that the response code is 4xx
1182+
*/
1183+
public function seeResponseCodeIsClientError()
1184+
{
1185+
$this->connectionModule->seeResponseCodeIsClientError();
1186+
}
1187+
1188+
/**
1189+
* Checks that the response code is 5xx
1190+
*/
1191+
public function seeResponseCodeIsServerError()
1192+
{
1193+
$this->connectionModule->seeResponseCodeIsServerError();
1194+
}
1195+
1196+
11641197
/**
11651198
* Checks whether last response was valid XML.
11661199
* This is done with libxml_get_last_error function.

0 commit comments

Comments
 (0)