mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
155 lines
4.4 KiB
PHP
155 lines
4.4 KiB
PHP
<?php
|
|
/**
|
|
* AccountControllerTest.php
|
|
* Copyright (C) 2016 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.
|
|
*/
|
|
|
|
namespace Chart;
|
|
|
|
use TestCase;
|
|
|
|
/**
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-12-07 at 18:50:33.
|
|
*/
|
|
class AccountControllerTest extends TestCase
|
|
{
|
|
|
|
|
|
/**
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
* This method is called before a test is executed.
|
|
*/
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts
|
|
* @dataProvider dateRangeProvider
|
|
*
|
|
* @param string $range
|
|
*/
|
|
public function testExpenseAccounts(string $range)
|
|
{
|
|
$this->be($this->user());
|
|
$this->changeDateRange($this->user(), $range);
|
|
$this->call('get', route('chart.account.expense'));
|
|
$this->assertResponseStatus(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);
|
|
$this->call('get', route('chart.account.expense-budget', [1, '20120101', '20120131']));
|
|
$this->assertResponseStatus(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);
|
|
$this->call('get', route('chart.account.expense-category', [1, '20120101', '20120131']));
|
|
$this->assertResponseStatus(200);
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::frontpage
|
|
* @dataProvider dateRangeProvider
|
|
*
|
|
* @param string $range
|
|
*/
|
|
public function testFrontpage(string $range)
|
|
{
|
|
$this->be($this->user());
|
|
$this->changeDateRange($this->user(), $range);
|
|
$this->call('get', route('chart.account.frontpage'));
|
|
$this->assertResponseStatus(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);
|
|
$this->call('get', route('chart.account.income-category', [1, '20120101', '20120131']));
|
|
$this->assertResponseStatus(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);
|
|
$this->call('get', route('chart.account.period', [1, '2012-01-01']));
|
|
$this->assertResponseStatus(200);
|
|
}
|
|
|
|
/**
|
|
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::report
|
|
*/
|
|
public function testReport()
|
|
{
|
|
$this->be($this->user());
|
|
$this->call('get', route('chart.account.report', ['1', '20120101', '20120131']));
|
|
$this->assertResponseStatus(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);
|
|
$this->call('get', route('chart.account.revenue'));
|
|
$this->assertResponseStatus(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);
|
|
$this->call('get', route('chart.account.single', [1]));
|
|
$this->assertResponseStatus(200);
|
|
}
|
|
|
|
}
|