mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +00:00
Basic set of tests (incomplete).
This commit is contained in:
148
tests/acceptance/Controllers/Auth/AuthControllerTest.php
Normal file
148
tests/acceptance/Controllers/Auth/AuthControllerTest.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthControllerTest.php
|
||||
* Copyright (C) 2016 Sander Dorigo
|
||||
*
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:40:28.
|
||||
*/
|
||||
class AuthControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Auth\AuthController::getLogin
|
||||
*/
|
||||
public function testGetLogin()
|
||||
{
|
||||
$response = $this->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.'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user