firefly-iii/tests/acceptance/Controllers/PreferencesControllerTest.php

51 lines
1.3 KiB
PHP
Raw Normal View History

2016-01-19 23:20:09 -06:00
<?php
/**
* PreferencesControllerTest.php
* Copyright (C) 2016 Sander Dorigo
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
/**
* Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:28.
*/
class PreferencesControllerTest extends TestCase
{
/**
* @covers FireflyIII\Http\Controllers\PreferencesController::index
2016-02-04 00:30:48 -06:00
* @covers FireflyIII\Http\Controllers\PreferencesController::__construct
2016-01-19 23:20:09 -06:00
*/
public function testIndex()
{
2016-02-04 00:30:48 -06:00
$this->be($this->user());
$this->call('GET', '/preferences');
$this->assertResponseStatus(200);
2016-01-19 23:20:09 -06:00
}
/**
2016-02-05 08:41:40 -06:00
* @covers FireflyIII\Http\Controllers\PreferencesController::postIndex
* @dataProvider dateRangeProvider
2016-02-05 08:41:40 -06:00
*
* @param $range
2016-01-19 23:20:09 -06:00
*/
public function testPostIndex($range)
2016-01-19 23:20:09 -06:00
{
2016-02-04 00:30:48 -06:00
$args = [
'frontPageAccounts' => [1],
'viewRange' => $range,
2016-02-04 00:30:48 -06:00
'budgetMaximum' => 100,
'customFiscalYear' => 1,
'fiscalYearStart' => '01-01',
'language' => 'en_US',
];
$this->be($this->user());
$this->call('POST', '/preferences', $args);
$this->assertResponseStatus(302);
$this->assertSessionHas('success');
2016-01-19 23:20:09 -06:00
}
}