I have a very basic test where I test the logout process.
This is my test:
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Validation\ValidationException;
class LoginTest extends TestCase
{
use DatabaseMigrations;
/** @test */
public function logging_out_the_current_user()
{
$this->withExceptionHandling();
\Auth::login(factory(\App\User::class)->create());
$response = $this->get('/logout');
$response->assertRedirect('/login');
$this->assertFalse(\Auth::check());
}
}
When I dump the $response->getContents() I get the following response:
@rin4ikPlease stop asking people to just blindly alter vendor files. You NEVER want to do that. Especially if you aren't warning them that updating their app will undo their changes. It's just almost never an appropriate thing to do.
Since AuthenticatesUsers is a trait used in the login controller, all you'd have to do is override the logout function in your login controller with your own.
Tests\Feature\RegisterTest::password_is_required
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'http://site/register'
+'http://site'
When I do this on the website itself it returns normal to the register page with an password error. Am I missing something?