firefly-iii/tests/Feature/Controllers/Chart/AccountControllerTest.php

146 lines
4.6 KiB
PHP
Raw Normal View History

2017-02-12 10:58:16 -06:00
<?php
/**
* AccountControllerTest.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace Tests\Feature\Controllers\Chart;
use Tests\TestCase;
class AccountControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts
2017-02-24 14:01:33 -06:00
* @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface::singleSet
2017-02-12 10:58:16 -06:00
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testExpenseAccounts(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.expense'));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseBudget
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testExpenseBudget(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.expense-budget', [1, '20120101', '20120131']));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseCategory
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testExpenseCategory(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.expense-category', [1, '20120101', '20120131']));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::frontpage
2017-02-17 13:14:38 -06:00
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::__construct
2017-02-24 14:01:33 -06:00
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::accountBalanceChart
* @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface::multiSet
2017-02-12 10:58:16 -06:00
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testFrontpage(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.frontpage'));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::incomeCategory
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testIncomeCategory(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.income-category', [1, '20120101', '20120131']));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::period
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testPeriod(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.period', [1, '2012-01-01']));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::report
*/
public function testReport()
{
$this->be($this->user());
$response = $this->get(route('chart.account.report', ['1', '20120101', '20120131']));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::revenueAccounts
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testRevenueAccounts(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.revenue'));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::single
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testSingle(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.single', [1]));
$response->assertStatus(200);
}
2017-02-16 15:33:32 -06:00
}