Im using Codeception with Yii2. I need to do a POST request with json content body. I dont want to use REST module cause have not even been able config it yet. (Thats a longer story...)
I have been able to write my GET tests fantastic. Now with the first POST test, Im stuck.
- There is a
$I->amOnPage([])method in Functional Test which can only do GET request. sendAjaxPostdoes not allow sending content body with POST.$I->sendPOST('api/xyz',"{\"xyz\":1}")also did not work cause Yii did not get any route so instead loaded the homepage. The path got lost in the call stacks.- There is a
InnerBrowser->_loadPagemethod which allows me to do a request with all configurable way but I cannot find a way to access it.
Any way to get access to InnerBrowser object from the test?
I have tried $I->getModule('PhpBrowser')->_loadPage or $this->getModule('Yii2')