firefly-iii/tests/acceptance/Controllers/Popup/ReportControllerTest.php
2016-12-10 16:32:52 +01:00

150 lines
4.4 KiB
PHP

<?php
/**
* ReportControllerTest.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 Popup;
use Carbon\Carbon;
use TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:42.
*/
class ReportControllerTest 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\Popup\ReportController::general
*/
public function testBalanceAmount()
{
$this->be($this->user());
$arguments = [
'attributes' => [
'location' => 'balance-amount',
'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
'accounts' => 1,
'accountId' => 1,
'categoryId' => 1,
'budgetId' => 1,
'role' => 1,
],
];
$uri = route('popup.general') . '?' . http_build_query($arguments);
$this->call('get', $uri);
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
*/
public function testBudgetSpentAmount()
{
$this->be($this->user());
$arguments = [
'attributes' => [
'location' => 'budget-spent-amount',
'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
'accounts' => 1,
'accountId' => 1,
'categoryId' => 1,
'budgetId' => 1,
],
];
$uri = route('popup.general') . '?' . http_build_query($arguments);
$this->call('get', $uri);
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
*/
public function testCategoryEntry()
{
$this->be($this->user());
$arguments = [
'attributes' => [
'location' => 'category-entry',
'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
'accounts' => 1,
'accountId' => 1,
'categoryId' => 1,
'budgetId' => 1,
],
];
$uri = route('popup.general') . '?' . http_build_query($arguments);
$this->call('get', $uri);
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
*/
public function testExpenseEntry()
{
$this->be($this->user());
$arguments = [
'attributes' => [
'location' => 'expense-entry',
'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
'accounts' => 1,
'accountId' => 1,
'categoryId' => 1,
'budgetId' => 1,
],
];
$uri = route('popup.general') . '?' . http_build_query($arguments);
$this->call('get', $uri);
$this->assertResponseStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
*/
public function testIncomeEntry()
{
$this->be($this->user());
$arguments = [
'attributes' => [
'location' => 'income-entry',
'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
'accounts' => 1,
'accountId' => 1,
'categoryId' => 1,
'budgetId' => 1,
],
];
$uri = route('popup.general') . '?' . http_build_query($arguments);
$this->call('get', $uri);
$this->assertResponseStatus(200);
}
}