mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
expand tests
This commit is contained in:
@@ -36,6 +36,14 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
return User::find(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function toBeDeletedUser()
|
||||
{
|
||||
return User::find(3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
|
@@ -14,6 +14,7 @@ class AccountControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\AccountController::create
|
||||
* @covers FireflyIII\Http\Controllers\AccountController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
@@ -77,6 +78,9 @@ class AccountControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\AccountController::store
|
||||
* @covers FireflyIII\Http\Requests\AccountFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\AccountFormRequest::rules
|
||||
*
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
@@ -97,6 +101,8 @@ class AccountControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\AccountController::update
|
||||
* @covers FireflyIII\Http\Requests\AccountFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\AccountFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
|
@@ -15,6 +15,7 @@ class AttachmentControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\AttachmentController::delete
|
||||
* @covers FireflyIII\Http\Controllers\AttachmentController::__construct
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
@@ -42,6 +43,8 @@ class AttachmentControllerTest extends TestCase
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/attachment/download/1');
|
||||
$this->assertResponseStatus(200);
|
||||
// must have certain headers
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,6 +69,8 @@ class AttachmentControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\AttachmentController::update
|
||||
* @covers FireflyIII\Http\Requests\AttachmentFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\AttachmentFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
|
@@ -13,43 +13,6 @@
|
||||
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
|
||||
*/
|
||||
@@ -62,14 +25,16 @@ class AuthControllerTest extends TestCase
|
||||
// index should now redirect:
|
||||
$this->call('GET', '/');
|
||||
$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 = [
|
||||
'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 = [
|
||||
'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->assertResponseStatus(200);
|
||||
|
@@ -16,6 +16,7 @@ class BillControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BillController::create
|
||||
* @covers FireflyIII\Http\Controllers\BillController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
@@ -26,7 +27,6 @@ class BillControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BillController::delete
|
||||
* @todo Implement testDelete().
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
@@ -90,6 +90,9 @@ class BillControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
@@ -115,6 +118,9 @@ class BillControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
|
@@ -15,6 +15,7 @@ class BudgetControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::amount
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::__construct
|
||||
*/
|
||||
public function testAmount()
|
||||
{
|
||||
@@ -116,13 +117,15 @@ class BudgetControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::store
|
||||
* @covers FireflyIII\Http\Requests\BudgetFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\BudgetFormRequest::rules
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->session(['budgets.create.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'name' => 'Some kind of test budget.',
|
||||
'name' => 'Some kind of test budget.',
|
||||
];
|
||||
|
||||
$this->call('POST', '/budgets/store', $args);
|
||||
@@ -132,13 +135,16 @@ class BudgetControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::update
|
||||
* @covers FireflyIII\Http\Requests\BudgetFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\BudgetFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->session(['budgets.edit.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'name' => 'Some kind of test budget.',
|
||||
'name' => 'Some kind of test budget.',
|
||||
'id' => 1,
|
||||
];
|
||||
|
||||
$this->call('POST', '/budgets/update/1', $args);
|
||||
|
@@ -16,6 +16,7 @@ class CategoryControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\CategoryController::create
|
||||
* @covers FireflyIII\Http\Controllers\CategoryController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
@@ -102,13 +103,15 @@ class CategoryControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\CategoryController::store
|
||||
* @covers FireflyIII\Http\Requests\CategoryFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\CategoryFormRequest::rules
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->session(['categories.create.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'name' => 'Some kind of test cat.',
|
||||
'name' => 'Some kind of test cat.',
|
||||
];
|
||||
|
||||
$this->call('POST', '/categories/store', $args);
|
||||
@@ -118,13 +121,16 @@ class CategoryControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\CategoryController::update
|
||||
* @covers FireflyIII\Http\Requests\CategoryFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\CategoryFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->session(['categories.edit.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'name' => 'Some kind of test category.',
|
||||
'name' => 'Some kind of test category.',
|
||||
'id' => 1,
|
||||
];
|
||||
|
||||
$this->call('POST', '/categories/update/1', $args);
|
||||
|
@@ -14,6 +14,7 @@ class ChartAccountControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts
|
||||
* @covers FireflyIII\Http\Controllers\Chart\AccountController::__construct
|
||||
*/
|
||||
public function testExpenseAccounts()
|
||||
{
|
||||
|
@@ -15,6 +15,7 @@ class ChartBillControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Chart\BillController::frontpage
|
||||
* @covers FireflyIII\Http\Controllers\Chart\BillController::__construct
|
||||
*/
|
||||
public function testFrontpage()
|
||||
{
|
||||
|
@@ -18,6 +18,7 @@ class ChartBudgetControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Chart\BudgetController::budget
|
||||
* @covers FireflyIII\Http\Controllers\Chart\BudgetController::__construct
|
||||
*/
|
||||
public function testBudget()
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@ class ChartCategoryControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Chart\CategoryController::all
|
||||
* @covers FireflyIII\Http\Controllers\Chart\CategoryController::__construct
|
||||
*/
|
||||
public function testAll()
|
||||
{
|
||||
|
@@ -15,6 +15,7 @@ class ChartPiggyBankControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::history
|
||||
* @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::__construct
|
||||
*/
|
||||
public function testHistory()
|
||||
{
|
||||
|
@@ -14,6 +14,7 @@ class ChartReportControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\Chart\ReportController::yearInOut
|
||||
* @covers FireflyIII\Http\Controllers\Chart\ReportController::__construct
|
||||
*/
|
||||
public function testYearInOut()
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@ class CsvControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\CsvController::columnRoles
|
||||
* @covers FireflyIII\Http\Controllers\CsvController::__construct
|
||||
*/
|
||||
public function testColumnRoles()
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@ class CurrencyControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\CurrencyController::create
|
||||
* @covers FireflyIII\Http\Controllers\CurrencyController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
@@ -82,6 +83,9 @@ class CurrencyControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
@@ -101,6 +105,9 @@ class CurrencyControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::__construct
|
||||
*/
|
||||
public function testShow()
|
||||
{
|
||||
|
@@ -11,6 +11,7 @@ class HomeControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::__construct
|
||||
*/
|
||||
public function testDateRange()
|
||||
{
|
||||
|
@@ -17,6 +17,7 @@ class JsonControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\JsonController::action
|
||||
* @covers FireflyIII\Http\Controllers\JsonController::__construct
|
||||
*/
|
||||
public function testAction()
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@ class NewUserControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\NewUserController::index
|
||||
* @covers FireflyIII\Http\Controllers\NewUserController::__construct
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
@@ -37,14 +38,18 @@ class NewUserControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\NewUserController::submit
|
||||
* @covers FireflyIII\Http\Requests\NewUserFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\NewUserFormRequest::rules
|
||||
*/
|
||||
public function testSubmit()
|
||||
{
|
||||
$this->be($this->emptyUser());
|
||||
|
||||
$args = [
|
||||
'bank_name' => 'New bank',
|
||||
'bank_balance' => 100,
|
||||
'bank_name' => 'New bank',
|
||||
'bank_balance' => 100,
|
||||
'savings_balance' => 200,
|
||||
'credit_card_limit' => 1000,
|
||||
];
|
||||
|
||||
$this->call('POST', '/new-user/submit', $args);
|
||||
|
@@ -15,6 +15,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PiggyBankController::add
|
||||
* @covers FireflyIII\Http\Controllers\PiggyBankController::__construct
|
||||
*/
|
||||
public function testAdd()
|
||||
{
|
||||
@@ -35,7 +36,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PiggyBankController::delete
|
||||
* @todo Implement testDelete().
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
@@ -93,7 +93,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PiggyBankController::postAdd
|
||||
* @todo Implement testPostAdd().
|
||||
*/
|
||||
public function testPostAdd()
|
||||
{
|
||||
@@ -144,6 +143,8 @@ class PiggyBankControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PiggyBankController::store
|
||||
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::rules
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
@@ -163,6 +164,8 @@ class PiggyBankControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PiggyBankController::update
|
||||
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\PiggyBankFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
@@ -173,6 +176,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
'name' => 'Updated',
|
||||
'targetamount' => 100,
|
||||
'account_id' => 2,
|
||||
'id' => 1,
|
||||
];
|
||||
|
||||
$this->call('POST', '/piggy-banks/update/1', $args);
|
||||
|
@@ -16,25 +16,32 @@ class PreferencesControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PreferencesController::index
|
||||
* @todo Implement testIndex().
|
||||
* @covers FireflyIII\Http\Controllers\PreferencesController::__construct
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/preferences');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\PreferencesController::postIndex
|
||||
* @todo Implement testPostIndex().
|
||||
*/
|
||||
public function testPostIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$args = [
|
||||
'frontPageAccounts' => [1],
|
||||
'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');
|
||||
}
|
||||
}
|
||||
|
@@ -15,61 +15,69 @@ class ProfileControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\ProfileController::changePassword
|
||||
* @todo Implement testChangePassword().
|
||||
* @covers FireflyIII\Http\Controllers\ProfileController::__construct
|
||||
*/
|
||||
public function testChangePassword()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/profile/change-password');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\ProfileController::deleteAccount
|
||||
* @todo Implement testDeleteAccount().
|
||||
*/
|
||||
public function testDeleteAccount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/profile/delete-account');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\ProfileController::index
|
||||
* @todo Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/profile');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\ProfileController::postChangePassword
|
||||
* @todo Implement testPostChangePassword().
|
||||
* @covers FireflyIII\Http\Requests\ProfileFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\ProfileFormRequest::rules
|
||||
*/
|
||||
public function testPostChangePassword()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$args = [
|
||||
'current_password' => 'james',
|
||||
'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
|
||||
* @todo Implement testPostDeleteAccount().
|
||||
* @covers FireflyIII\Http\Requests\DeleteAccountFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\DeleteAccountFormRequest::rules
|
||||
*/
|
||||
public function testPostDeleteAccount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$args = [
|
||||
'password' => 'james',
|
||||
];
|
||||
|
||||
$this->be($this->toBeDeletedUser());
|
||||
$this->call('POST', '/profile/delete-account', $args);
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertRedirectedToRoute('index');
|
||||
$this->assertNull(DB::table('users')->find(3));
|
||||
}
|
||||
}
|
||||
|
@@ -7,69 +7,67 @@
|
||||
* 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.
|
||||
*/
|
||||
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
|
||||
* @todo Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/reports');
|
||||
$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
|
||||
* @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->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/reports/report/default/20160101/20161231/1,2');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
@@ -15,134 +15,163 @@ class RuleControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::__construct
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::create
|
||||
* @todo Implement testCreate().
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/create/1');
|
||||
$this->assertResponseStatus(200);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::delete
|
||||
* @todo Implement testDelete().
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/rules/delete/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::destroy
|
||||
* @todo Implement testDestroy().
|
||||
*/
|
||||
public function testDestroy()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['rules.rule.delete.url' => 'http://localhost']);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/rules/destroy/1');
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::down
|
||||
* @todo Implement testDown().
|
||||
*/
|
||||
public function testDown()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/rules/down/1');
|
||||
$this->assertResponseStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::edit
|
||||
* @todo Implement testEdit().
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::getCurrentTriggers
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::getCurrentActions
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/rules/edit/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::index
|
||||
* @todo Implement testIndex().
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::createDefaultRuleGroup
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::createDefaultRule
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::reorderRuleActions
|
||||
* @todo Implement testReorderRuleActions().
|
||||
*/
|
||||
public function testReorderRuleActions()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$args = ['actions' => [1, 2, 3]];
|
||||
$this->call('POST', '/rules/rules/action/reorder/1', $args);
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::reorderRuleTriggers
|
||||
* @todo Implement testReorderRuleTriggers().
|
||||
*/
|
||||
public function testReorderRuleTriggers()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$args = ['actions' => [1, 2]];
|
||||
$this->call('POST', '/rules/rules/trigger/reorder/1', $args);
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::store
|
||||
* @todo Implement testStore().
|
||||
* @covers FireflyIII\Http\Requests\RuleFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\RuleFormRequest::rules
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['rules.rule.create.url' => 'http://localhost']);
|
||||
$this->be($this->user());
|
||||
$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
|
||||
* @todo Implement testUp().
|
||||
*/
|
||||
public function testUp()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/rules/up/1');
|
||||
$this->assertResponseStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleController::update
|
||||
* @todo Implement testUpdate().
|
||||
* @covers FireflyIII\Http\Requests\RuleFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\RuleFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['rules.rule.edit.url' => 'http://localhost']);
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
@@ -16,97 +16,105 @@ class RuleGroupControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::create
|
||||
* @todo Implement testCreate().
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/groups/create');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::delete
|
||||
* @todo Implement testDelete().
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/groups/delete/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::destroy
|
||||
* @todo Implement testDestroy().
|
||||
*/
|
||||
public function testDestroy()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['rules.rule-group.delete.url' => 'http://localhost']);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/rules/groups/destroy/1');
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::down
|
||||
* @todo Implement testDown().
|
||||
*/
|
||||
public function testDown()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/groups/down/1');
|
||||
$this->assertResponseStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::edit
|
||||
* @todo Implement testEdit().
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/groups/edit/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::store
|
||||
* @todo Implement testStore().
|
||||
* @covers FireflyIII\Http\Requests\RuleGroupFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\RuleGroupFormRequest::rules
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['rules.rule-group.create.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'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
|
||||
* @todo Implement testUp().
|
||||
*/
|
||||
public function testUp()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/rules/groups/up/1');
|
||||
$this->assertResponseStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\RuleGroupController::update
|
||||
* @todo Implement testUpdate().
|
||||
* @covers FireflyIII\Http\Requests\RuleGroupFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\RuleGroupFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['rules.rule-group.edit.url' => 'http://localhost']);
|
||||
$args = [
|
||||
'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');
|
||||
}
|
||||
}
|
||||
|
@@ -14,14 +14,13 @@
|
||||
class SearchControllerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\SearchController::__construct
|
||||
* @covers FireflyIII\Http\Controllers\SearchController::index
|
||||
* @todo Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/search?q=test&search=');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
}
|
||||
|
@@ -15,110 +15,115 @@ class TagControllerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::__construct
|
||||
* @covers FireflyIII\Http\Controllers\TagController::create
|
||||
* @todo Implement testCreate().
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/tags/create');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::delete
|
||||
* @todo Implement testDelete().
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/tags/delete/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::destroy
|
||||
* @todo Implement testDestroy().
|
||||
*/
|
||||
public function testDestroy()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/tags/destroy/1');
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::edit
|
||||
* @todo Implement testEdit().
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/tags/edit/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::hideTagHelp
|
||||
* @todo Implement testHideTagHelp().
|
||||
*/
|
||||
public function testHideTagHelp()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/tags/hideTagHelp/true');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::index
|
||||
* @todo Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/tags');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::show
|
||||
* @todo Implement testShow().
|
||||
*/
|
||||
public function testShow()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/tags/show/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TagController::store
|
||||
* @todo Implement testStore().
|
||||
* @covers FireflyIII\Http\Requests\TagFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\TagFormRequest::rules
|
||||
*/
|
||||
public function testStore()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$args = [
|
||||
'tag' => 'Some new tag',
|
||||
'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
|
||||
* @todo Implement testUpdate().
|
||||
* @covers FireflyIII\Http\Requests\TagFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\TagFormRequest::rules
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$args = [
|
||||
'tag' => 'Some new tag yay',
|
||||
'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');
|
||||
}
|
||||
}
|
||||
|
@@ -16,109 +16,130 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::create
|
||||
* @todo Implement testCreate().
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::__construct
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transactions/create/withdrawal');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::delete
|
||||
* @todo Implement testDelete().
|
||||
*/
|
||||
public function testDelete()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transaction/delete/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::destroy
|
||||
* @todo Implement testDestroy().
|
||||
*/
|
||||
public function testDestroy()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['transactions.delete.url' => 'http://localhost']);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/transaction/destroy/1');
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::edit
|
||||
* @todo Implement testEdit().
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transaction/edit/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::index
|
||||
* @todo Implement testIndex().
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transactions/deposit');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::reorder
|
||||
* @todo Implement testReorder().
|
||||
*/
|
||||
public function testReorder()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$args = [
|
||||
'ids' => [1],
|
||||
'date' => '2015-01-01',
|
||||
];
|
||||
$this->be($this->user());
|
||||
$this->call('POST', '/transaction/reorder', $args);
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\TransactionController::show
|
||||
* @todo Implement testShow().
|
||||
*/
|
||||
public function testShow()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/transaction/show/1');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['transactions.create.url' => 'http://localhost']);
|
||||
|
||||
$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
|
||||
* @todo Implement testUpdate().
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::authorize
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::rules
|
||||
* @covers FireflyIII\Http\Requests\JournalFormRequest::getJournalData
|
||||
*/
|
||||
public function testUpdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
$this->session(['transactions.edit.url' => 'http://localhost']);
|
||||
|
||||
$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');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user