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

58 lines
1.5 KiB
PHP
Raw Normal View History

2016-01-17 00:18:35 -06:00
<?php
/**
* HomeControllerTest.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.
*/
2016-02-07 00:56:58 -06:00
2016-01-17 00:18:35 -06:00
class HomeControllerTest extends TestCase
{
2016-01-19 09:55:53 -06:00
/**
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
2016-02-04 00:30:48 -06:00
* @covers FireflyIII\Http\Controllers\HomeController::__construct
2016-01-19 09:55:53 -06:00
*/
2016-01-17 00:18:35 -06:00
public function testDateRange()
{
$this->be($this->user());
$args = [
2016-01-19 09:55:53 -06:00
'start' => '2012-01-01',
'end' => '2012-04-01',
2016-01-17 00:18:35 -06:00
];
// if date range is > 50, should have flash.
2016-01-24 11:11:57 -06:00
$this->call('POST', '/daterange', $args);
$this->assertResponseStatus(200);
2016-01-17 00:18:35 -06:00
$this->assertSessionHas('warning', '91 days of data may take a while to load.');
}
2016-01-19 09:55:53 -06:00
/**
* @covers FireflyIII\Http\Controllers\HomeController::flush
*/
2016-01-17 08:48:18 -06:00
public function testFlush()
{
$this->be($this->user());
2016-01-24 11:11:57 -06:00
$this->call('GET', '/flush');
$this->assertResponseStatus(302);
2016-01-17 08:48:18 -06:00
}
2016-01-19 09:55:53 -06:00
/**
2016-02-05 08:41:40 -06:00
* @covers FireflyIII\Http\Controllers\HomeController::index
* @covers FireflyIII\Http\Controllers\Controller::__construct
* @dataProvider dateRangeProvider
2016-02-05 08:41:40 -06:00
*
* @param $range
2016-01-19 09:55:53 -06:00
*/
public function testIndex($range)
2016-01-17 08:48:18 -06:00
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
2016-01-24 11:11:57 -06:00
$this->call('GET', '/');
$this->assertResponseStatus(200);
2016-01-17 08:48:18 -06:00
}
}