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->assertSessionHas('isLoggedIn', 'yes'); $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, '_token' => Session::token(), ]; $response = $this->call('POST', '/login', $args); $this->assertEquals(302, $response->status()); $this->assertSessionHas('isLoggedIn', 'yes'); } /** * @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::redirectPath * @todo Implement testRedirectPath(). */ public function testRedirectPath() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::register * @todo Implement testRegister(). */ public function testRegister() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::showLoginForm * @todo Implement testShowLoginForm(). */ public function testShowLoginForm() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } /** * @covers FireflyIII\Http\Controllers\Auth\AuthController::showRegistrationForm * @todo Implement testShowRegistrationForm(). */ public function testShowRegistrationForm() { // Remove the following lines when you implement this test. $this->markTestIncomplete( 'This test has not been implemented yet.' ); } }