mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); $repository->shouldReceive('getExpensesPerMonth')->once()->andReturn(new Collection([new Budget])); $repository->shouldReceive('getFirstBudgetLimitDate')->once()->andReturn(new Carbon); $this->be($this->user()); $response = $this->call('GET', '/chart/budget/1'); $this->assertEquals(200, $response->status()); //$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.'); } /** * @covers FireflyIII\Http\Controllers\Chart\BudgetController::budgetLimit */ public function testBudgetLimit() { $this->be($this->user()); $response = $this->call('GET', '/chart/budget/1/1'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\Chart\BudgetController::frontpage */ public function testFrontpage() { $this->be($this->user()); $response = $this->call('GET', '/chart/budget/frontpage'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\Chart\BudgetController::multiYear */ public function testMultiYear() { $budget = new Budget; $budget->id = 1; $budget->dateFormatted = '2015'; $budget->budgeted = 120; $repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); $repository->shouldReceive('getBudgetedPerYear')->once()->andReturn(new Collection([$budget])); $repository->shouldReceive('getBudgetsAndExpensesPerYear')->once()->andReturn([]); $this->be($this->user()); $response = $this->call('GET', '/chart/budget/multi-year/default/20150101/20160101/1/1'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\Chart\BudgetController::year */ public function testYear() { $repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); $repository->shouldReceive('getBudgetsAndExpensesPerMonth')->once()->andReturn([]); $this->be($this->user()); $response = $this->call('GET', '/chart/budget/year/default/20150101/20151231/1'); $this->assertEquals(200, $response->status()); } }