Answer the question
In order to leave comments, you need to log in
Codeception one file one test?
Began acquaintance with testing (through codeception).
I use the REST API, and in the best TDD methods, I write the test first, then the implementation.
I have a controller, it should have several methods. I wrote a test and an implementation of one method.
The test turned out to be redundant, but I can afford it:
<?php
$I = new ApiTester($scenario);
$I->sendGET('category/children');
$I->seeResponseCodeIs(200);
$I->haveHttpHeader('Content-Type','application/json');
$I->seeResponseIsJson();
//$I->seeResponseContains('"status":1');
$I->seeResponseContainsJson(['status' => 1]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question