call('GET', '/login'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::getLogout */ public function testGetLogout() { $this->be($this->user()); $this->call('GET', '/logout'); $this->assertResponseStatus(302); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::getRegister */ public function testGetRegister() { $this->call('GET', '/register'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::login */ public function testLogin() { $this->call('GET', '/login'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::logout */ public function testLogout() { $this->be($this->user()); $this->call('GET', '/logout'); $this->assertResponseStatus(302); // index should now redirect: $this->call('GET', '/'); $this->assertResponseStatus(302); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::postLogin */ public function testPostLogin() { $args = [ 'email' => 'thegrumpydictator@gmail.com', 'password' => 'james', 'remember' => 1, ]; $this->call('POST', '/login', $args); $this->assertResponseStatus(302); $this->call('GET', '/'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::postRegister */ public function testPostRegister() { $args = [ 'email' => 'thegrumpydictator+test@gmail.com', 'password' => 'james123', 'password_confirmation' => 'james123', ]; $this->call('POST', '/register', $args); $this->assertResponseStatus(302); $this->assertSessionHas('start'); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::register */ public function testRegister() { $this->call('GET', '/register'); $this->assertResponseStatus(200); } }