be($this->user()); $this->call('GET', '/chart/category/1/all'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Chart\CategoryController::currentPeriod */ public function testCurrentPeriod() { $this->be($this->user()); $this->call('GET', '/chart/category/1/period'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Chart\CategoryController::earnedInPeriod */ public function testEarnedInPeriod() { $repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface'); $repository->shouldReceive('earnedForAccountsPerMonth')->once()->andReturn(new Collection); $this->be($this->user()); $this->call('GET', '/chart/category/earned-in-period/default/20150101/20151231/1'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Chart\CategoryController::frontpage */ public function testFrontpage() { $repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface'); $repository->shouldReceive('spentForAccountsPerMonth')->once()->andReturn(new Collection); $repository->shouldReceive('sumSpentNoCategory')->once()->andReturn('120'); $this->be($this->user()); $this->call('GET', '/chart/category/frontpage'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Chart\CategoryController::multiYear */ public function testMultiYear() { $repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface'); $repository->shouldReceive('listMultiYear')->once()->andReturn(new Collection); $this->be($this->user()); $this->call('GET', '/chart/category/multi-year/default/20150101/20151231/1/1'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Chart\CategoryController::specificPeriod */ public function testSpecificPeriod() { $this->be($this->user()); $this->call('GET', '/chart/category/1/period/20150101'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\Chart\CategoryController::spentInPeriod */ public function testSpentInPeriod() { $repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface'); $repository->shouldReceive('spentForAccountsPerMonth')->once()->andReturn(new Collection); $this->be($this->user()); $this->call('GET', '/chart/category/spent-in-period/default/20150101/20151231/1'); $this->assertResponseStatus(200); } }