mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 20:16:22 +00:00
Updated tests.
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
<?php
|
||||
//exec('php artisan migrate --seed --env=testing');
|
||||
// This is global bootstrap for autoloading
|
||||
$db = realpath(__DIR__ . '/_data') . '/testing.sqlite';
|
||||
|
||||
if (!file_exists($db)) {
|
||||
exec('touch ' . $db);
|
||||
exec('php artisan migrate --seed --env=testing');
|
||||
}
|
||||
exec('cp ' . $db . ' ' . realpath(__DIR__ . '/_data') . '/clean.sqlite');
|
||||
|
||||
/**
|
||||
* Class resetToClean
|
||||
* @SuppressWarnings("CamelCase")
|
||||
*/
|
||||
//
|
||||
//
|
||||
//$db = realpath(__DIR__ . '/_data') . '/testing.sqlite';
|
||||
//if (!file_exists($db)) {
|
||||
// echo 'Recreating database...' . "\n";
|
||||
// exec('touch ' . $db);
|
||||
//
|
||||
//} else {
|
||||
// echo 'Database exists!' . "\n";
|
||||
//}
|
||||
//echo 'Copy database to clean database (turned off)...' . "\n";
|
||||
//exec('cp ' . $db . ' ' . realpath(__DIR__ . '/_data') . '/clean.sqlite');
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * Class resetToClean
|
||||
// * @SuppressWarnings("CamelCase")
|
||||
// */
|
||||
class resetToClean
|
||||
{
|
||||
/**
|
||||
@@ -19,6 +26,6 @@ class resetToClean
|
||||
*/
|
||||
static public function clean()
|
||||
{
|
||||
exec('cp ' . realpath(__DIR__ . '/_data') . '/clean.sqlite ' . realpath(__DIR__ . '/_data') . '/testing.sqlite');
|
||||
//exec('cp ' . realpath(__DIR__ . '/_data') . '/clean.sqlite ' . realpath(__DIR__ . '/_data') . '/testing.sqlite');
|
||||
}
|
||||
}
|
||||
1798
tests/_data/dump.sql
Normal file
1798
tests/_data/dump.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,15 @@ class BudgetControllerCest
|
||||
public function amount(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update the amount for a budget and limit repetition');
|
||||
$I->amOnPage('/budgets/income');
|
||||
$I->amOnPage('/budgets');
|
||||
|
||||
///budgets/income
|
||||
|
||||
$I->sendAjaxPostRequest('/budgets/amount/1', ['amount' => 100]);
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->see('Groceries');
|
||||
$I->seeInDatabase('budgets', ['id' => 1]);
|
||||
#$I->seeInDatabase('budget_limits', ['budget_id' => 1, 'amount' => 100.00]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,12 +66,12 @@ class BudgetControllerCest
|
||||
public function destroy(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('destroy a budget');
|
||||
#$I->amOnPage('/budgets/delete/3');
|
||||
#$I->see('Delete budget "Delete me"');
|
||||
#$I->submitForm('#destroy', []);
|
||||
#$I->see('Budget "Delete me" was deleted.');
|
||||
#$I->dontSeeInDatabase('components', ['name' => 'Delete me', 'class' => 'Budget','deleted_at' => null]);
|
||||
//resetToClean::clean();
|
||||
$I->amOnPage('/budgets/delete/3');
|
||||
$I->see('Delete budget "Delete me"');
|
||||
$I->submitForm('#destroy', []);
|
||||
$I->see('Budget "Delete me" was deleted.');
|
||||
#$I->dontSeeInDatabase('budgets', ['name' => 'Delete me','deleted_at' => null]);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +97,12 @@ class BudgetControllerCest
|
||||
*/
|
||||
public function postUpdateIncome(FunctionalTester $I)
|
||||
{
|
||||
$date = date('FY');
|
||||
$I->wantTo('process the update to my monthly income');
|
||||
$I->amOnPage('/budgets/income');
|
||||
$I->see('Update (expected) income for');
|
||||
$I->submitForm('#income', ['amount' => 1200]);
|
||||
$I->seeRecord('preferences', ['name' => 'budgetIncomeTotal' . $date, 'data' => 1200]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user