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