Did you leave a dump somewhere in the underlying code?
If you can run the dump-server while executing the test in a separate console, you should see the file and line number that is causing that output.
Hi,
I'm trying to write a test to check if a non-existing urlKey is redirecting to the global redirect url.
But when I run the phpunit in my console, the output contains the redirect body of the $response
For example:
mywebsite.com/non-existing-url must redirect to a global domain, which is set in the config file
This is my test:
/** @test */
public function it_will_redirect_to_global_redirect_url()
{
$urlKey = 'non-existing-url';
$response = $this->get(route('website', $urlKey));
$response->assertRedirect(config('app.redirect_url'));
}
And this is my output
$ phpunit
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
.<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url='https://www.redirected-domain.com/'" />
<title>Redirecting to https://www.redirected-domain.com/</title>
</head>
<body>
Redirecting to <a href="https://www.redirected-domain.com/">https://www.redirected-domain.com/</a>.
</body>
</html>. 2 / 2 (100%)
Time: 619 ms, Memory: 26.00 MB
OK (2 tests, 3 assertions)
Is there anything wrong in the test, or is it something else I have to set? Despite the tests are passing, it is very annoying seeing this in the console.
Please or to participate in this conversation.