firefly-iii/tests/acceptance/Controllers/PreferencesControllerTest.php
2016-02-05 15:41:40 +01:00

51 lines
1.3 KiB
PHP

<?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
* @covers FireflyIII\Http\Controllers\PreferencesController::__construct
*/
public function testIndex()
{
$this->be($this->user());
$this->call('GET', '/preferences');
$this->assertResponseStatus(200);
}
/**
* @covers FireflyIII\Http\Controllers\PreferencesController::postIndex
* @dataProvider dateRangeProvider
*
* @param $range
*/
public function testPostIndex($range)
{
$args = [
'frontPageAccounts' => [1],
'viewRange' => $range,
'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');
}
}