mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Test updates.
This commit is contained in:
parent
256dba66b2
commit
83b7cb4ff9
@ -146,7 +146,7 @@ class BudgetController extends BaseController
|
||||
public function show(Budget $budget, LimitRepetition $repetition = null)
|
||||
{
|
||||
if (!is_null($repetition) && $repetition->budgetLimit->budget->id != $budget->id) {
|
||||
App::abort(500);
|
||||
return View::make('error')->with('message','Invalid selection.');
|
||||
}
|
||||
|
||||
$hideBudget = true; // used in transaction list.
|
||||
|
@ -33,7 +33,23 @@ class TestContentSeeder extends Seeder
|
||||
// create two budgets:
|
||||
$groceriesBudget = Budget::create(['user_id' => $user->id, 'name' => 'Groceries']);
|
||||
$billsBudget = Budget::create(['user_id' => $user->id, 'name' => 'Bills']);
|
||||
Budget::create(['user_id' => $user->id, 'name' => 'Delete me']);
|
||||
$deleteBudget = Budget::create(['user_id' => $user->id, 'name' => 'Delete me']);
|
||||
|
||||
// some limits:
|
||||
$limitOne = BudgetLimit::create(
|
||||
['startdate' => '2014-01-01', 'amount' => 200, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $groceriesBudget->id]
|
||||
);
|
||||
$limitTwo = BudgetLimit::create(
|
||||
['startdate' => '2014-01-01', 'amount' => 200, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $billsBudget->id]
|
||||
);
|
||||
$limitThree = BudgetLimit::create(
|
||||
['startdate' => '2014-01-01', 'amount' => 200, 'repeats' => 0, 'repeat_freq' => 'monthly', 'budget_id' => $deleteBudget->id]
|
||||
);
|
||||
|
||||
// and because we have no filters, some repetitions:
|
||||
$repOne = LimitRepetition::create(['budget_limit_id' => $limitOne->id, 'startdate' => '2014-01-01', 'enddate' => '2014-01-31', 'amount' => 200]);
|
||||
$repOne = LimitRepetition::create(['budget_limit_id' => $limitTwo->id, 'startdate' => '2014-01-01', 'enddate' => '2014-01-31', 'amount' => 200]);
|
||||
$repOne = LimitRepetition::create(['budget_limit_id' => $limitThree->id, 'startdate' => '2014-01-01', 'enddate' => '2014-01-31', 'amount' => 200]);
|
||||
|
||||
// create two categories:
|
||||
$dailyGroceries = Category::create(['user_id' => $user->id, 'name' => 'DailyGroceries']);
|
||||
|
222
app/tests/PiggybankPartTest.php
Normal file
222
app/tests/PiggybankPartTest.php
Normal file
@ -0,0 +1,222 @@
|
||||
<?php
|
||||
use FireflyIII\Collection\PiggybankPart;
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator on 2014-12-20 at 06:56:52.
|
||||
*/
|
||||
class PiggybankPartTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var PiggybankPart
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new PiggybankPart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getReminder
|
||||
* @todo Implement testGetReminder().
|
||||
*/
|
||||
public function testGetReminder()
|
||||
{
|
||||
$this->object->getReminder();
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setReminder
|
||||
* @todo Implement testSetReminder().
|
||||
*/
|
||||
public function testSetReminder()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getStartdate
|
||||
* @todo Implement testGetStartdate().
|
||||
*/
|
||||
public function testGetStartdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setStartdate
|
||||
* @todo Implement testSetStartdate().
|
||||
*/
|
||||
public function testSetStartdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getTargetdate
|
||||
* @todo Implement testGetTargetdate().
|
||||
*/
|
||||
public function testGetTargetdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setTargetdate
|
||||
* @todo Implement testSetTargetdate().
|
||||
*/
|
||||
public function testSetTargetdate()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getRepetition
|
||||
* @todo Implement testGetRepetition().
|
||||
*/
|
||||
public function testGetRepetition()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setRepetition
|
||||
* @todo Implement testSetRepetition().
|
||||
*/
|
||||
public function testSetRepetition()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::hasReminder
|
||||
* @todo Implement testHasReminder().
|
||||
*/
|
||||
public function testHasReminder()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::percentage
|
||||
* @todo Implement testPercentage().
|
||||
*/
|
||||
public function testPercentage()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getCurrentamount
|
||||
* @todo Implement testGetCurrentamount().
|
||||
*/
|
||||
public function testGetCurrentamount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setCurrentamount
|
||||
* @todo Implement testSetCurrentamount().
|
||||
*/
|
||||
public function testSetCurrentamount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getCumulativeAmount
|
||||
* @todo Implement testGetCumulativeAmount().
|
||||
*/
|
||||
public function testGetCumulativeAmount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setCumulativeAmount
|
||||
* @todo Implement testSetCumulativeAmount().
|
||||
*/
|
||||
public function testSetCumulativeAmount()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::getAmountPerBar
|
||||
* @todo Implement testGetAmountPerBar().
|
||||
*/
|
||||
public function testGetAmountPerBar()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Collection\PiggybankPart::setAmountPerBar
|
||||
* @todo Implement testSetAmountPerBar().
|
||||
*/
|
||||
public function testSetAmountPerBar()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
}
|
@ -1,24 +1,14 @@
|
||||
<?php
|
||||
//exec('php artisan migrate --seed --env=testing');
|
||||
// This is global bootstrap for autoloading
|
||||
//
|
||||
//
|
||||
//$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")
|
||||
// */
|
||||
$db = realpath(__DIR__ . '/_data') . '/db.sqlite';
|
||||
if(!file_exists($db)) {
|
||||
exec('touch '.$db);
|
||||
exec('php artisan migrate --seed --env=testing');
|
||||
exec('sqlite3 tests/_data/db.sqlite .dump > tests/_data/dump.sql');
|
||||
}
|
||||
|
||||
/**
|
||||
* Class resetToClean
|
||||
*/
|
||||
class resetToClean
|
||||
{
|
||||
/**
|
||||
|
Binary file not shown.
1798
tests/_data/dump.sql
1798
tests/_data/dump.sql
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,9 @@
|
||||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
// here you can define custom actions
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class FunctionalHelper extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -114,6 +114,16 @@ class BudgetControllerCest
|
||||
$I->amOnPage('/budgets/show/1');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function showInvalidRepetition(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('show a budget with a repetition that does not match the budget.');
|
||||
$I->amOnPage('/budgets/show/1/3');
|
||||
$I->see('Invalid selection');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user