Issues with $response->getBody() returning blank after a redirect

Hi Folks,

I’m currently trying to flesh out a thorough testsuite for my website that I’m creating in Slim but having an issue where $response->getBody() is empty after a redirect is performed in the controller. For instance the assert line is $this->assertContains(‘You have been successfully logged in’, (string)$response->getBody());

I’ve dumped out various parts of the code and can see that basically everything is working, the assert before this works - $this->assertEquals(302, $response->getStatusCode());

I’m using PHPUnit for the test suite but I’m wondering if I’m missing something with all of this. I’ve checked over the BaseTestCase in PHPStorm and it’s flagging to me that the return $response is not returning \Slim\Http\Response, rather \Pst\Http\Message\ResponseInterface (not sure if this is actually an issue or not).

The project itself is at https://github.com/railto/PersonalSite and I’d really appreciate any help on this as it’s driving me mad.

Once I get this sorted out my next step is to try and run tests as an authenticated user.

Thanks in advance.

Mark aka railto