mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +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');
|
||||
|
||||
Reference in New Issue
Block a user