mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Code cleanup.
This commit is contained in:
@@ -57,6 +57,24 @@ class BudgetControllerTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::amount
|
||||
*/
|
||||
public function testAmountZero()
|
||||
{
|
||||
$repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$limitRepetition = FactoryMuffin::create('FireflyIII\Models\LimitRepetition');
|
||||
$budget = $limitRepetition->budgetlimit->budget;
|
||||
$this->be($budget->user);
|
||||
$today = new Carbon;
|
||||
|
||||
$this->session(['start' => $today]);
|
||||
$repository->shouldReceive('updateLimitAmount')->once()->andReturn($limitRepetition);
|
||||
$this->call('POST', '/budgets/amount/' . $budget->id, ['amount' => 0, '_token' => 'replaceme']);
|
||||
$this->assertResponseOk();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::create
|
||||
*/
|
||||
@@ -128,12 +146,13 @@ class BudgetControllerTest extends TestCase
|
||||
$collection = new Collection;
|
||||
$collection->push($budget);
|
||||
$repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$repetition = FactoryMuffin::create('FireflyIII\Models\LimitRepetition');
|
||||
|
||||
$repository->shouldReceive('getActiveBudgets')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getInactiveBudgets')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('cleanupBudgets')->once();
|
||||
$repository->shouldReceive('spentInPeriodCorrected')->once();
|
||||
$repository->shouldReceive('getCurrentRepetition')->once();
|
||||
$repository->shouldReceive('getCurrentRepetition')->once()->andReturn($repetition);
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('x');
|
||||
Amount::shouldReceive('format')->andReturn('x');
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
|
||||
@@ -38,6 +38,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* Everything present and accounted for, and in cache:
|
||||
*
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
*/
|
||||
public function testGetHelpText()
|
||||
@@ -59,6 +60,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* Everything present and accounted for, but not cached
|
||||
*
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
*/
|
||||
public function testGetHelpTextNoCache()
|
||||
@@ -82,6 +84,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* No such route.
|
||||
*
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
*/
|
||||
public function testGetHelpTextNoRoute()
|
||||
|
||||
@@ -360,16 +360,16 @@ class TransactionControllerTest extends TestCase
|
||||
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
|
||||
$piggy = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||
$piggy = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$this->be($account->user);
|
||||
|
||||
$account2->user_id = $account->user_id;
|
||||
$account->account_type_id = $asset->id;
|
||||
$account2->account_type_id = $asset->id;
|
||||
$piggy->account_id = $account->id;
|
||||
$piggy->account_id = $account->id;
|
||||
$account->save();
|
||||
$account2->save();
|
||||
$piggy->save();
|
||||
|
||||
Reference in New Issue
Block a user