mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 23:50:09 +00:00
Restored some tests.
This commit is contained in:
63
tests/acceptance/Controllers/HomeControllerTest.php
Executable file
63
tests/acceptance/Controllers/HomeControllerTest.php
Executable file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* HomeControllerTest.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.
|
||||
*/
|
||||
class HomeControllerTest extends TestCase
|
||||
{
|
||||
public function displayError()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::__construct
|
||||
*/
|
||||
public function testDateRange()
|
||||
{
|
||||
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
'start' => '2012-01-01',
|
||||
'end' => '2012-04-01',
|
||||
];
|
||||
|
||||
// if date range is > 50, should have flash.
|
||||
$this->call('POST', '/daterange', $args);
|
||||
$this->assertResponseStatus(200);
|
||||
$this->assertSessionHas('warning', '91 days of data may take a while to load.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::flush
|
||||
*/
|
||||
public function testFlush()
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->call('GET', '/flush');
|
||||
$this->assertResponseStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\HomeController::index
|
||||
* @covers FireflyIII\Http\Controllers\Controller::__construct
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param $range
|
||||
*/
|
||||
public function testIndex($range)
|
||||
{
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$this->call('GET', '/');
|
||||
$this->assertResponseStatus(200);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user