mock(GeneratorInterface::class); $repository = $this->mock(BillRepositoryInterface::class); $repository->shouldReceive('getBillsPaidInRange')->once()->andReturn('-1'); $repository->shouldReceive('getBillsUnpaidInRange')->once()->andReturn('2'); $generator->shouldReceive('pieChart')->once()->andReturn([]); $this->be($this->user()); $this->changeDateRange($this->user(), $range); $response = $this->get(route('chart.bill.frontpage')); $response->assertStatus(200); } /** * @covers \FireflyIII\Http\Controllers\Chart\BillController::single */ public function testSingle() { $generator = $this->mock(GeneratorInterface::class); $collector = $this->mock(JournalCollectorInterface::class); $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once(); $collector->shouldReceive('setBills')->andReturnSelf()->once(); $collector->shouldReceive('getJournals')->andReturn(new Collection)->once(); $generator->shouldReceive('multiSet')->once()->andReturn([]); $this->be($this->user()); $response = $this->get(route('chart.bill.single', [1])); $response->assertStatus(200); } }