expand tests

This commit is contained in:
James Cole
2016-02-04 07:30:48 +01:00
parent fb119cc208
commit 3690a53dc9
28 changed files with 432 additions and 325 deletions

View File

@@ -36,6 +36,14 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
return User::find(2); return User::find(2);
} }
/**
* @return User
*/
public function toBeDeletedUser()
{
return User::find(3);
}
/** /**
* Sets up the fixture, for example, opens a network connection. * Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed. * This method is called before a test is executed.

View File

@@ -14,6 +14,7 @@ class AccountControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\AccountController::create * @covers FireflyIII\Http\Controllers\AccountController::create
* @covers FireflyIII\Http\Controllers\AccountController::__construct
*/ */
public function testCreate() public function testCreate()
{ {
@@ -77,6 +78,9 @@ class AccountControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\AccountController::store * @covers FireflyIII\Http\Controllers\AccountController::store
* @covers FireflyIII\Http\Requests\AccountFormRequest::authorize
* @covers FireflyIII\Http\Requests\AccountFormRequest::rules
*
*/ */
public function testStore() public function testStore()
{ {
@@ -97,6 +101,8 @@ class AccountControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\AccountController::update * @covers FireflyIII\Http\Controllers\AccountController::update
* @covers FireflyIII\Http\Requests\AccountFormRequest::authorize
* @covers FireflyIII\Http\Requests\AccountFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {

View File

@@ -15,6 +15,7 @@ class AttachmentControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\AttachmentController::delete * @covers FireflyIII\Http\Controllers\AttachmentController::delete
* @covers FireflyIII\Http\Controllers\AttachmentController::__construct
*/ */
public function testDelete() public function testDelete()
{ {
@@ -42,6 +43,8 @@ class AttachmentControllerTest extends TestCase
$this->be($this->user()); $this->be($this->user());
$this->call('GET', '/attachment/download/1'); $this->call('GET', '/attachment/download/1');
$this->assertResponseStatus(200); $this->assertResponseStatus(200);
// must have certain headers
} }
/** /**
@@ -66,6 +69,8 @@ class AttachmentControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\AttachmentController::update * @covers FireflyIII\Http\Controllers\AttachmentController::update
* @covers FireflyIII\Http\Requests\AttachmentFormRequest::authorize
* @covers FireflyIII\Http\Requests\AttachmentFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {

View File

@@ -13,43 +13,6 @@
class AuthControllerTest extends TestCase class AuthControllerTest extends TestCase
{ {
/**
* @covers FireflyIII\Http\Controllers\Auth\AuthController::getLogin
*/
public function testGetLogin()
{
$this->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 * @covers FireflyIII\Http\Controllers\Auth\AuthController::logout
*/ */
@@ -62,14 +25,16 @@ class AuthControllerTest extends TestCase
// index should now redirect: // index should now redirect:
$this->call('GET', '/'); $this->call('GET', '/');
$this->assertResponseStatus(302); $this->assertResponseStatus(302);
} }
/** /**
* @covers FireflyIII\Http\Controllers\Auth\AuthController::postLogin * @covers FireflyIII\Http\Controllers\Auth\AuthController::login
* @covers FireflyIII\Http\Controllers\Auth\AuthController::__construct
* @covers FireflyIII\Http\Controllers\Auth\AuthController::sendFailedLoginResponse
* @covers FireflyIII\Http\Controllers\Auth\AuthController::getFailedLoginMessage
*
*/ */
public function testPostLogin() public function testLogin()
{ {
$args = [ $args = [
'email' => 'thegrumpydictator@gmail.com', 'email' => 'thegrumpydictator@gmail.com',
@@ -86,9 +51,13 @@ class AuthControllerTest extends TestCase
} }
/** /**
* @covers FireflyIII\Http\Controllers\Auth\AuthController::postRegister * @covers FireflyIII\Http\Controllers\Auth\AuthController::register
* @covers FireflyIII\Http\Controllers\Auth\AuthController::create
* @covers FireflyIII\Http\Controllers\Auth\AuthController::isBlockedDomain
* @covers FireflyIII\Http\Controllers\Auth\AuthController::getBlockedDomains
* @covers FireflyIII\Http\Controllers\Auth\AuthController::validator
*/ */
public function testPostRegister() public function testRegister()
{ {
$args = [ $args = [
'email' => 'thegrumpydictator+test@gmail.com', 'email' => 'thegrumpydictator+test@gmail.com',
@@ -101,9 +70,9 @@ class AuthControllerTest extends TestCase
} }
/** /**
* @covers FireflyIII\Http\Controllers\Auth\AuthController::register * @covers FireflyIII\Http\Controllers\Auth\AuthController::showRegistrationForm
*/ */
public function testRegister() public function testShowRegistrationForm()
{ {
$this->call('GET', '/register'); $this->call('GET', '/register');
$this->assertResponseStatus(200); $this->assertResponseStatus(200);

View File

@@ -16,6 +16,7 @@ class BillControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BillController::create * @covers FireflyIII\Http\Controllers\BillController::create
* @covers FireflyIII\Http\Controllers\BillController::__construct
*/ */
public function testCreate() public function testCreate()
{ {
@@ -26,7 +27,6 @@ class BillControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BillController::delete * @covers FireflyIII\Http\Controllers\BillController::delete
* @todo Implement testDelete().
*/ */
public function testDelete() public function testDelete()
{ {
@@ -90,6 +90,9 @@ class BillControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BillController::store * @covers FireflyIII\Http\Controllers\BillController::store
* @covers FireflyIII\Http\Requests\BillFormRequest::authorize
* @covers FireflyIII\Http\Requests\BillFormRequest::getBillData
* @covers FireflyIII\Http\Requests\BillFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
@@ -115,6 +118,9 @@ class BillControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BillController::update * @covers FireflyIII\Http\Controllers\BillController::update
* @covers FireflyIII\Http\Requests\BillFormRequest::authorize
* @covers FireflyIII\Http\Requests\BillFormRequest::getBillData
* @covers FireflyIII\Http\Requests\BillFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {

View File

@@ -15,6 +15,7 @@ class BudgetControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\BudgetController::amount * @covers FireflyIII\Http\Controllers\BudgetController::amount
* @covers FireflyIII\Http\Controllers\BudgetController::__construct
*/ */
public function testAmount() public function testAmount()
{ {
@@ -116,13 +117,15 @@ class BudgetControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BudgetController::store * @covers FireflyIII\Http\Controllers\BudgetController::store
* @covers FireflyIII\Http\Requests\BudgetFormRequest::authorize
* @covers FireflyIII\Http\Requests\BudgetFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
$this->be($this->user()); $this->be($this->user());
$this->session(['budgets.create.url' => 'http://localhost']); $this->session(['budgets.create.url' => 'http://localhost']);
$args = [ $args = [
'name' => 'Some kind of test budget.', 'name' => 'Some kind of test budget.',
]; ];
$this->call('POST', '/budgets/store', $args); $this->call('POST', '/budgets/store', $args);
@@ -132,13 +135,16 @@ class BudgetControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BudgetController::update * @covers FireflyIII\Http\Controllers\BudgetController::update
* @covers FireflyIII\Http\Requests\BudgetFormRequest::authorize
* @covers FireflyIII\Http\Requests\BudgetFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {
$this->be($this->user()); $this->be($this->user());
$this->session(['budgets.edit.url' => 'http://localhost']); $this->session(['budgets.edit.url' => 'http://localhost']);
$args = [ $args = [
'name' => 'Some kind of test budget.', 'name' => 'Some kind of test budget.',
'id' => 1,
]; ];
$this->call('POST', '/budgets/update/1', $args); $this->call('POST', '/budgets/update/1', $args);

View File

@@ -16,6 +16,7 @@ class CategoryControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CategoryController::create * @covers FireflyIII\Http\Controllers\CategoryController::create
* @covers FireflyIII\Http\Controllers\CategoryController::__construct
*/ */
public function testCreate() public function testCreate()
{ {
@@ -102,13 +103,15 @@ class CategoryControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CategoryController::store * @covers FireflyIII\Http\Controllers\CategoryController::store
* @covers FireflyIII\Http\Requests\CategoryFormRequest::authorize
* @covers FireflyIII\Http\Requests\CategoryFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
$this->be($this->user()); $this->be($this->user());
$this->session(['categories.create.url' => 'http://localhost']); $this->session(['categories.create.url' => 'http://localhost']);
$args = [ $args = [
'name' => 'Some kind of test cat.', 'name' => 'Some kind of test cat.',
]; ];
$this->call('POST', '/categories/store', $args); $this->call('POST', '/categories/store', $args);
@@ -118,13 +121,16 @@ class CategoryControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CategoryController::update * @covers FireflyIII\Http\Controllers\CategoryController::update
* @covers FireflyIII\Http\Requests\CategoryFormRequest::authorize
* @covers FireflyIII\Http\Requests\CategoryFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {
$this->be($this->user()); $this->be($this->user());
$this->session(['categories.edit.url' => 'http://localhost']); $this->session(['categories.edit.url' => 'http://localhost']);
$args = [ $args = [
'name' => 'Some kind of test category.', 'name' => 'Some kind of test category.',
'id' => 1,
]; ];
$this->call('POST', '/categories/update/1', $args); $this->call('POST', '/categories/update/1', $args);

View File

@@ -14,6 +14,7 @@ class ChartAccountControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts * @covers FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts
* @covers FireflyIII\Http\Controllers\Chart\AccountController::__construct
*/ */
public function testExpenseAccounts() public function testExpenseAccounts()
{ {

View File

@@ -15,6 +15,7 @@ class ChartBillControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\Chart\BillController::frontpage * @covers FireflyIII\Http\Controllers\Chart\BillController::frontpage
* @covers FireflyIII\Http\Controllers\Chart\BillController::__construct
*/ */
public function testFrontpage() public function testFrontpage()
{ {

View File

@@ -18,6 +18,7 @@ class ChartBudgetControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\Chart\BudgetController::budget * @covers FireflyIII\Http\Controllers\Chart\BudgetController::budget
* @covers FireflyIII\Http\Controllers\Chart\BudgetController::__construct
*/ */
public function testBudget() public function testBudget()
{ {

View File

@@ -16,6 +16,7 @@ class ChartCategoryControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\Chart\CategoryController::all * @covers FireflyIII\Http\Controllers\Chart\CategoryController::all
* @covers FireflyIII\Http\Controllers\Chart\CategoryController::__construct
*/ */
public function testAll() public function testAll()
{ {

View File

@@ -15,6 +15,7 @@ class ChartPiggyBankControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::history * @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::history
* @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::__construct
*/ */
public function testHistory() public function testHistory()
{ {

View File

@@ -14,6 +14,7 @@ class ChartReportControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\Chart\ReportController::yearInOut * @covers FireflyIII\Http\Controllers\Chart\ReportController::yearInOut
* @covers FireflyIII\Http\Controllers\Chart\ReportController::__construct
*/ */
public function testYearInOut() public function testYearInOut()
{ {

View File

@@ -16,6 +16,7 @@ class CsvControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\CsvController::columnRoles * @covers FireflyIII\Http\Controllers\CsvController::columnRoles
* @covers FireflyIII\Http\Controllers\CsvController::__construct
*/ */
public function testColumnRoles() public function testColumnRoles()
{ {

View File

@@ -16,6 +16,7 @@ class CurrencyControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::create * @covers FireflyIII\Http\Controllers\CurrencyController::create
* @covers FireflyIII\Http\Controllers\CurrencyController::__construct
*/ */
public function testCreate() public function testCreate()
{ {
@@ -82,6 +83,9 @@ class CurrencyControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::store * @covers FireflyIII\Http\Controllers\CurrencyController::store
* @covers FireflyIII\Http\Requests\CurrencyFormRequest::authorize
* @covers FireflyIII\Http\Requests\CurrencyFormRequest::rules
* @covers FireflyIII\Http\Requests\CurrencyFormRequest::getCurrencyData
*/ */
public function testStore() public function testStore()
{ {
@@ -101,6 +105,9 @@ class CurrencyControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::update * @covers FireflyIII\Http\Controllers\CurrencyController::update
* @covers FireflyIII\Http\Requests\CurrencyFormRequest::authorize
* @covers FireflyIII\Http\Requests\CurrencyFormRequest::rules
* @covers FireflyIII\Http\Requests\CurrencyFormRequest::getCurrencyData
*/ */
public function testUpdate() public function testUpdate()
{ {

View File

@@ -16,6 +16,7 @@ class HelpControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\HelpController::show * @covers FireflyIII\Http\Controllers\HelpController::show
* @covers FireflyIII\Http\Controllers\HelpController::__construct
*/ */
public function testShow() public function testShow()
{ {

View File

@@ -11,6 +11,7 @@ class HomeControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\HomeController::dateRange * @covers FireflyIII\Http\Controllers\HomeController::dateRange
* @covers FireflyIII\Http\Controllers\HomeController::__construct
*/ */
public function testDateRange() public function testDateRange()
{ {

View File

@@ -17,6 +17,7 @@ class JsonControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\JsonController::action * @covers FireflyIII\Http\Controllers\JsonController::action
* @covers FireflyIII\Http\Controllers\JsonController::__construct
*/ */
public function testAction() public function testAction()
{ {

View File

@@ -16,6 +16,7 @@ class NewUserControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\NewUserController::index * @covers FireflyIII\Http\Controllers\NewUserController::index
* @covers FireflyIII\Http\Controllers\NewUserController::__construct
*/ */
public function testIndex() public function testIndex()
{ {
@@ -37,14 +38,18 @@ class NewUserControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\NewUserController::submit * @covers FireflyIII\Http\Controllers\NewUserController::submit
* @covers FireflyIII\Http\Requests\NewUserFormRequest::authorize
* @covers FireflyIII\Http\Requests\NewUserFormRequest::rules
*/ */
public function testSubmit() public function testSubmit()
{ {
$this->be($this->emptyUser()); $this->be($this->emptyUser());
$args = [ $args = [
'bank_name' => 'New bank', 'bank_name' => 'New bank',
'bank_balance' => 100, 'bank_balance' => 100,
'savings_balance' => 200,
'credit_card_limit' => 1000,
]; ];
$this->call('POST', '/new-user/submit', $args); $this->call('POST', '/new-user/submit', $args);

View File

@@ -15,6 +15,7 @@ class PiggyBankControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\PiggyBankController::add * @covers FireflyIII\Http\Controllers\PiggyBankController::add
* @covers FireflyIII\Http\Controllers\PiggyBankController::__construct
*/ */
public function testAdd() public function testAdd()
{ {
@@ -35,7 +36,6 @@ class PiggyBankControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\PiggyBankController::delete * @covers FireflyIII\Http\Controllers\PiggyBankController::delete
* @todo Implement testDelete().
*/ */
public function testDelete() public function testDelete()
{ {
@@ -93,7 +93,6 @@ class PiggyBankControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\PiggyBankController::postAdd * @covers FireflyIII\Http\Controllers\PiggyBankController::postAdd
* @todo Implement testPostAdd().
*/ */
public function testPostAdd() public function testPostAdd()
{ {
@@ -144,6 +143,8 @@ class PiggyBankControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\PiggyBankController::store * @covers FireflyIII\Http\Controllers\PiggyBankController::store
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::authorize
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
@@ -163,6 +164,8 @@ class PiggyBankControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\PiggyBankController::update * @covers FireflyIII\Http\Controllers\PiggyBankController::update
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::authorize
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {
@@ -173,6 +176,7 @@ class PiggyBankControllerTest extends TestCase
'name' => 'Updated', 'name' => 'Updated',
'targetamount' => 100, 'targetamount' => 100,
'account_id' => 2, 'account_id' => 2,
'id' => 1,
]; ];
$this->call('POST', '/piggy-banks/update/1', $args); $this->call('POST', '/piggy-banks/update/1', $args);

View File

@@ -16,25 +16,32 @@ class PreferencesControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\PreferencesController::index * @covers FireflyIII\Http\Controllers\PreferencesController::index
* @todo Implement testIndex(). * @covers FireflyIII\Http\Controllers\PreferencesController::__construct
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/preferences');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\PreferencesController::postIndex * @covers FireflyIII\Http\Controllers\PreferencesController::postIndex
* @todo Implement testPostIndex().
*/ */
public function testPostIndex() public function testPostIndex()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( 'frontPageAccounts' => [1],
'This test has not been implemented yet.' 'viewRange' => '1M',
); 'budgetMaximum' => 100,
'customFiscalYear' => 1,
'fiscalYearStart' => '01-01',
'language' => 'en_US',
];
$this->be($this->user());
$this->call('POST', '/preferences', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
} }

View File

@@ -15,61 +15,69 @@ class ProfileControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\ProfileController::changePassword * @covers FireflyIII\Http\Controllers\ProfileController::changePassword
* @todo Implement testChangePassword(). * @covers FireflyIII\Http\Controllers\ProfileController::__construct
*/ */
public function testChangePassword() public function testChangePassword()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/profile/change-password');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\ProfileController::deleteAccount * @covers FireflyIII\Http\Controllers\ProfileController::deleteAccount
* @todo Implement testDeleteAccount().
*/ */
public function testDeleteAccount() public function testDeleteAccount()
{ {
// Remove the following lines when you implement this test.
$this->markTestIncomplete( $this->be($this->user());
'This test has not been implemented yet.' $this->call('GET', '/profile/delete-account');
); $this->assertResponseStatus(200);
} }
/** /**
* @covers FireflyIII\Http\Controllers\ProfileController::index * @covers FireflyIII\Http\Controllers\ProfileController::index
* @todo Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/profile');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\ProfileController::postChangePassword * @covers FireflyIII\Http\Controllers\ProfileController::postChangePassword
* @todo Implement testPostChangePassword(). * @covers FireflyIII\Http\Requests\ProfileFormRequest::authorize
* @covers FireflyIII\Http\Requests\ProfileFormRequest::rules
*/ */
public function testPostChangePassword() public function testPostChangePassword()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( 'current_password' => 'james',
'This test has not been implemented yet.' 'new_password' => 'sander',
); 'new_password_confirmation' => 'sander',
];
$this->be($this->user());
$this->call('POST', '/profile/change-password', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\ProfileController::postDeleteAccount * @covers FireflyIII\Http\Controllers\ProfileController::postDeleteAccount
* @todo Implement testPostDeleteAccount(). * @covers FireflyIII\Http\Requests\DeleteAccountFormRequest::authorize
* @covers FireflyIII\Http\Requests\DeleteAccountFormRequest::rules
*/ */
public function testPostDeleteAccount() public function testPostDeleteAccount()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( 'password' => 'james',
'This test has not been implemented yet.' ];
);
$this->be($this->toBeDeletedUser());
$this->call('POST', '/profile/delete-account', $args);
$this->assertResponseStatus(302);
$this->assertRedirectedToRoute('index');
$this->assertNull(DB::table('users')->find(3));
} }
} }

View File

@@ -7,69 +7,67 @@
* of the MIT license. See the LICENSE file for details. * of the MIT license. See the LICENSE file for details.
*/ */
use FireflyIII\Helpers\Collection\Bill as BillCollection;
use FireflyIII\Helpers\Collection\Category as CategoryCollection;
use FireflyIII\Helpers\Collection\Expense;
use FireflyIII\Helpers\Collection\Income;
/** /**
* Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:28. * Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:28.
*/ */
class ReportControllerTest extends TestCase class ReportControllerTest extends TestCase
{ {
/**
* @covers FireflyIII\Http\Controllers\ReportController::defaultMonth
* @todo Implement testDefaultMonth().
*/
public function testDefaultMonth()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Http\Controllers\ReportController::defaultMultiYear
* @todo Implement testDefaultMultiYear().
*/
public function testDefaultMultiYear()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Http\Controllers\ReportController::defaultYear
* @todo Implement testDefaultYear().
*/
public function testDefaultYear()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/** /**
* @covers FireflyIII\Http\Controllers\ReportController::index * @covers FireflyIII\Http\Controllers\ReportController::index
* @todo Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/reports');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
}
/**
* @covers FireflyIII\Http\Controllers\ReportController::__construct
* @covers FireflyIII\Http\Controllers\ReportController::report
* @covers FireflyIII\Http\Controllers\ReportController::defaultMonth
*/
public function testReportDefaultMonth()
{
// mock some stuff.
$repository = $this->mock('FireflyIII\Helpers\Report\ReportHelperInterface');
$repository->shouldReceive('getCategoryReport')->once()->andReturn(new CategoryCollection);
$repository->shouldReceive('getIncomeReport')->once()->andReturn(new Income);
$repository->shouldReceive('getExpenseReport')->once()->andReturn(new Expense);
$repository->shouldReceive('getBillReport')->once()->andReturn(new BillCollection);
$this->be($this->user());
$this->call('GET', '/reports/report/default/20160101/20160131/1,2');
$this->assertResponseStatus(200);
} }
/** /**
* @covers FireflyIII\Http\Controllers\ReportController::report * @covers FireflyIII\Http\Controllers\ReportController::report
* @todo Implement testReport(). * @covers FireflyIII\Http\Controllers\ReportController::defaultYear
*/ */
public function testReport() public function testReportDefaultYear()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/reports/report/default/20160101/20161231/1,2');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
); }
/**
* @covers FireflyIII\Http\Controllers\ReportController::report
* @covers FireflyIII\Http\Controllers\ReportController::defaultMultiYear
*/
public function testReportDefaultMultiYear()
{
$this->be($this->user());
$this->call('GET', '/reports/report/default/20160101/20171231/1,2');
$this->assertResponseStatus(200);
} }
} }

View File

@@ -15,134 +15,163 @@ class RuleControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::__construct
* @covers FireflyIII\Http\Controllers\RuleController::create * @covers FireflyIII\Http\Controllers\RuleController::create
* @todo Implement testCreate().
*/ */
public function testCreate() public function testCreate()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/create/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::delete * @covers FireflyIII\Http\Controllers\RuleController::delete
* @todo Implement testDelete().
*/ */
public function testDelete() public function testDelete()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/rules/delete/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::destroy * @covers FireflyIII\Http\Controllers\RuleController::destroy
* @todo Implement testDestroy().
*/ */
public function testDestroy() public function testDestroy()
{ {
// Remove the following lines when you implement this test. $this->session(['rules.rule.delete.url' => 'http://localhost']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $this->be($this->user());
); $this->call('POST', '/rules/destroy/1');
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::down * @covers FireflyIII\Http\Controllers\RuleController::down
* @todo Implement testDown().
*/ */
public function testDown() public function testDown()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/rules/down/1');
'This test has not been implemented yet.' $this->assertResponseStatus(302);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::edit * @covers FireflyIII\Http\Controllers\RuleController::edit
* @todo Implement testEdit(). * @covers FireflyIII\Http\Controllers\RuleController::getCurrentTriggers
* @covers FireflyIII\Http\Controllers\RuleController::getCurrentActions
*/ */
public function testEdit() public function testEdit()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/rules/edit/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::index * @covers FireflyIII\Http\Controllers\RuleController::index
* @todo Implement testIndex(). * @covers FireflyIII\Http\Controllers\RuleController::createDefaultRuleGroup
* @covers FireflyIII\Http\Controllers\RuleController::createDefaultRule
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::reorderRuleActions * @covers FireflyIII\Http\Controllers\RuleController::reorderRuleActions
* @todo Implement testReorderRuleActions().
*/ */
public function testReorderRuleActions() public function testReorderRuleActions()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $args = ['actions' => [1, 2, 3]];
'This test has not been implemented yet.' $this->call('POST', '/rules/rules/action/reorder/1', $args);
); $this->assertResponseStatus(200);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::reorderRuleTriggers * @covers FireflyIII\Http\Controllers\RuleController::reorderRuleTriggers
* @todo Implement testReorderRuleTriggers().
*/ */
public function testReorderRuleTriggers() public function testReorderRuleTriggers()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $args = ['actions' => [1, 2]];
'This test has not been implemented yet.' $this->call('POST', '/rules/rules/trigger/reorder/1', $args);
); $this->assertResponseStatus(200);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::store * @covers FireflyIII\Http\Controllers\RuleController::store
* @todo Implement testStore(). * @covers FireflyIII\Http\Requests\RuleFormRequest::authorize
* @covers FireflyIII\Http\Requests\RuleFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
// Remove the following lines when you implement this test. $this->session(['rules.rule.create.url' => 'http://localhost']);
$this->markTestIncomplete( $this->be($this->user());
'This test has not been implemented yet.' $args = [
); 'rule_group_id' => 1,
'title' => 'Some new rule',
'user_id' => 1,
'trigger' => 'store-journal',
'description' => 'Some new rule',
'rule-trigger' => ['description_is'],
'rule-trigger-value' => ['something'],
'rule-trigger-stop' => [],
'rule-action' => ['set_category'],
'rule-action-value' => ['something'],
'rule-action-stop' => [],
'stop_processing' => 0,
];
$this->call('POST', '/rules/store/1', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::up * @covers FireflyIII\Http\Controllers\RuleController::up
* @todo Implement testUp().
*/ */
public function testUp() public function testUp()
{ {
// Remove the following lines when you implement this test.
$this->markTestIncomplete( $this->be($this->user());
'This test has not been implemented yet.' $this->call('GET', '/rules/rules/up/1');
); $this->assertResponseStatus(302);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleController::update * @covers FireflyIII\Http\Controllers\RuleController::update
* @todo Implement testUpdate(). * @covers FireflyIII\Http\Requests\RuleFormRequest::authorize
* @covers FireflyIII\Http\Requests\RuleFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {
// Remove the following lines when you implement this test. $this->session(['rules.rule.edit.url' => 'http://localhost']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $this->be($this->user());
); $args = [
'title' => 'Some new rule update',
'rule_group_id' => 1,
'id' => 1,
'active' => 1,
'trigger' => 'store-journal',
'description' => 'Some new rule',
'rule-trigger' => ['description_is'],
'rule-trigger-value' => ['something'],
'rule-trigger-stop' => [],
'rule-action' => ['set_category'],
'rule-action-value' => ['something'],
'rule-action-stop' => [],
'stop_processing' => 0,
];
$this->call('POST', '/rules/update/1', $args);
$this->assertSessionHas('success');
$this->assertResponseStatus(302);
} }
} }

View File

@@ -16,97 +16,105 @@ class RuleGroupControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::create * @covers FireflyIII\Http\Controllers\RuleGroupController::create
* @todo Implement testCreate(). * @covers FireflyIII\Http\Controllers\RuleGroupController::__construct
*/ */
public function testCreate() public function testCreate()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/groups/create');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::delete * @covers FireflyIII\Http\Controllers\RuleGroupController::delete
* @todo Implement testDelete().
*/ */
public function testDelete() public function testDelete()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/groups/delete/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::destroy * @covers FireflyIII\Http\Controllers\RuleGroupController::destroy
* @todo Implement testDestroy().
*/ */
public function testDestroy() public function testDestroy()
{ {
// Remove the following lines when you implement this test. $this->session(['rules.rule-group.delete.url' => 'http://localhost']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $this->be($this->user());
); $this->call('POST', '/rules/groups/destroy/1');
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::down * @covers FireflyIII\Http\Controllers\RuleGroupController::down
* @todo Implement testDown().
*/ */
public function testDown() public function testDown()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/groups/down/1');
'This test has not been implemented yet.' $this->assertResponseStatus(302);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::edit * @covers FireflyIII\Http\Controllers\RuleGroupController::edit
* @todo Implement testEdit().
*/ */
public function testEdit() public function testEdit()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/groups/edit/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::store * @covers FireflyIII\Http\Controllers\RuleGroupController::store
* @todo Implement testStore(). * @covers FireflyIII\Http\Requests\RuleGroupFormRequest::authorize
* @covers FireflyIII\Http\Requests\RuleGroupFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
// Remove the following lines when you implement this test. $this->session(['rules.rule-group.create.url' => 'http://localhost']);
$this->markTestIncomplete( $args = [
'This test has not been implemented yet.' 'title' => 'Some new rule group',
); 'description' => 'New rules',
];
$this->be($this->user());
$this->call('POST', '/rules/groups/store', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::up * @covers FireflyIII\Http\Controllers\RuleGroupController::up
* @todo Implement testUp().
*/ */
public function testUp() public function testUp()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/rules/groups/up/1');
'This test has not been implemented yet.' $this->assertResponseStatus(302);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\RuleGroupController::update * @covers FireflyIII\Http\Controllers\RuleGroupController::update
* @todo Implement testUpdate(). * @covers FireflyIII\Http\Requests\RuleGroupFormRequest::authorize
* @covers FireflyIII\Http\Requests\RuleGroupFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {
// Remove the following lines when you implement this test. $this->session(['rules.rule-group.edit.url' => 'http://localhost']);
$this->markTestIncomplete( $args = [
'This test has not been implemented yet.' 'id' => 1,
); 'title' => 'Some new rule group X',
'description' => 'New rules',
'active' => 1,
];
$this->be($this->user());
$this->call('POST', '/rules/groups/update/1', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
} }

View File

@@ -14,14 +14,13 @@
class SearchControllerTest extends TestCase class SearchControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\SearchController::__construct
* @covers FireflyIII\Http\Controllers\SearchController::index * @covers FireflyIII\Http\Controllers\SearchController::index
* @todo Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/search?q=test&search=');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
} }

View File

@@ -15,110 +15,115 @@ class TagControllerTest extends TestCase
{ {
/** /**
* @covers FireflyIII\Http\Controllers\TagController::__construct
* @covers FireflyIII\Http\Controllers\TagController::create * @covers FireflyIII\Http\Controllers\TagController::create
* @todo Implement testCreate().
*/ */
public function testCreate() public function testCreate()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/tags/create');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::delete * @covers FireflyIII\Http\Controllers\TagController::delete
* @todo Implement testDelete().
*/ */
public function testDelete() public function testDelete()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/tags/delete/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::destroy * @covers FireflyIII\Http\Controllers\TagController::destroy
* @todo Implement testDestroy().
*/ */
public function testDestroy() public function testDestroy()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('POST', '/tags/destroy/1');
'This test has not been implemented yet.' $this->assertResponseStatus(302);
); $this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::edit * @covers FireflyIII\Http\Controllers\TagController::edit
* @todo Implement testEdit().
*/ */
public function testEdit() public function testEdit()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/tags/edit/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::hideTagHelp * @covers FireflyIII\Http\Controllers\TagController::hideTagHelp
* @todo Implement testHideTagHelp().
*/ */
public function testHideTagHelp() public function testHideTagHelp()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('POST', '/tags/hideTagHelp/true');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::index * @covers FireflyIII\Http\Controllers\TagController::index
* @todo Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/tags');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::show * @covers FireflyIII\Http\Controllers\TagController::show
* @todo Implement testShow().
*/ */
public function testShow() public function testShow()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/tags/show/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::store * @covers FireflyIII\Http\Controllers\TagController::store
* @todo Implement testStore(). * @covers FireflyIII\Http\Requests\TagFormRequest::authorize
* @covers FireflyIII\Http\Requests\TagFormRequest::rules
*/ */
public function testStore() public function testStore()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( 'tag' => 'Some new tag',
'This test has not been implemented yet.' 'tagMode' => 'nothing',
); ];
$this->session(['tags.create.url' => 'http://localhost']);
$this->be($this->user());
$this->call('POST', '/tags/store', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\TagController::update * @covers FireflyIII\Http\Controllers\TagController::update
* @todo Implement testUpdate(). * @covers FireflyIII\Http\Requests\TagFormRequest::authorize
* @covers FireflyIII\Http\Requests\TagFormRequest::rules
*/ */
public function testUpdate() public function testUpdate()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( 'tag' => 'Some new tag yay',
'This test has not been implemented yet.' 'id' => 1,
); 'tagMode' => 'nothing',
];
$this->session(['tags.edit.url' => 'http://localhost']);
$this->be($this->user());
$this->call('POST', '/tags/update/1', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
} }

View File

@@ -16,109 +16,130 @@ class TransactionControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::create * @covers FireflyIII\Http\Controllers\TransactionController::create
* @todo Implement testCreate(). * @covers FireflyIII\Http\Controllers\TransactionController::__construct
*/ */
public function testCreate() public function testCreate()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/transactions/create/withdrawal');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::delete * @covers FireflyIII\Http\Controllers\TransactionController::delete
* @todo Implement testDelete().
*/ */
public function testDelete() public function testDelete()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/transaction/delete/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::destroy * @covers FireflyIII\Http\Controllers\TransactionController::destroy
* @todo Implement testDestroy().
*/ */
public function testDestroy() public function testDestroy()
{ {
// Remove the following lines when you implement this test. $this->session(['transactions.delete.url' => 'http://localhost']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $this->be($this->user());
); $this->call('POST', '/transaction/destroy/1');
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::edit * @covers FireflyIII\Http\Controllers\TransactionController::edit
* @todo Implement testEdit().
*/ */
public function testEdit() public function testEdit()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/transaction/edit/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::index * @covers FireflyIII\Http\Controllers\TransactionController::index
* @todo Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/transactions/deposit');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::reorder * @covers FireflyIII\Http\Controllers\TransactionController::reorder
* @todo Implement testReorder().
*/ */
public function testReorder() public function testReorder()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( 'ids' => [1],
'This test has not been implemented yet.' 'date' => '2015-01-01',
); ];
$this->be($this->user());
$this->call('POST', '/transaction/reorder', $args);
$this->assertResponseStatus(200);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::show * @covers FireflyIII\Http\Controllers\TransactionController::show
* @todo Implement testShow().
*/ */
public function testShow() public function testShow()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->call('GET', '/transaction/show/1');
'This test has not been implemented yet.' $this->assertResponseStatus(200);
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::store * @covers FireflyIII\Http\Controllers\TransactionController::store
* @todo Implement testStore(). * @covers FireflyIII\Http\Requests\JournalFormRequest::authorize
* @covers FireflyIII\Http\Requests\JournalFormRequest::rules
* @covers FireflyIII\Http\Requests\JournalFormRequest::getJournalData
*/ */
public function testStore() public function testStore()
{ {
// Remove the following lines when you implement this test. $this->session(['transactions.create.url' => 'http://localhost']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $args = [
); 'what' => 'withdrawal',
'description' => 'Something',
'account_id' => '1',
'expense_account' => 'Some expense',
'amount' => 100,
'amount_currency_id_amount' => 1,
'date' => '2015-01-01',
];
$this->be($this->user());
$this->call('POST', '/transactions/store/withdrawal', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\TransactionController::update * @covers FireflyIII\Http\Controllers\TransactionController::update
* @todo Implement testUpdate(). * @covers FireflyIII\Http\Requests\JournalFormRequest::authorize
* @covers FireflyIII\Http\Requests\JournalFormRequest::rules
* @covers FireflyIII\Http\Requests\JournalFormRequest::getJournalData
*/ */
public function testUpdate() public function testUpdate()
{ {
// Remove the following lines when you implement this test. $this->session(['transactions.edit.url' => 'http://localhost']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $args = [
); 'what' => 'withdrawal',
'id' => 2,
'description' => 'Something new',
'account_id' => '1',
'expense_account' => 'Some expense',
'amount' => 100,
'amount_currency_id_amount' => 1,
'date' => '2015-01-01',
];
$this->be($this->user());
$this->call('POST', '/transaction/update/1', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
} }
} }