I want to test if all the pages in my website are working, so I created an array with the routes in my admin page, go through the array and assert it status is equals to 200
But if it fails, it doesn't show me whitch page fails
...
class AdminTest extends TestCase {
use RefreshDatabase;
protected $main_pages = [
'/admin/dashboard',
'/admin/banners',
'/admin/benefits',
'/admin/plans',
'/admin/installation-fees',
'/admin/info-pages/a-doublenet',
'/admin/info-pages/servicos',
'/admin/informatives',
'/admin/faqs',
'/admin/contacts',
'/admin/hires',
'/admin/configs'
];
...
public function test_loads_main_admin_pages()
{
Auth::login(factory('App\User')->create());
foreach ($this->main_pages as $page) {
$this->get($page)
->assertStatus(200);
// Shows message: Unable to reach $page
}
}
}