Hello
I am writing feature tests that access post and get endpoints.
PHP Code:
public function testAbc()
{
$data = ['a' => 'a'];
$response = $this->post('abc', $data);
$response->assertRedirect();
}
public function testDef()
{
$response = $this->get('def', $data);
$response->assertNotRedirect();
}
Second assertion fails also controller does not have redirect. When I am dupming response value into console it looks sometimes fine or may contain previous response it some cases. It looks like response has data from the previous test for some reason. Why this happens? How it should be cleared?
Test class is defined like this:
PHP Code:
class MyFeatureTestCase extends CIUnitTestCase
{
use DatabaseTestTrait, FeatureTestTrait;