mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
More test data and an actual test.
This commit is contained in:
@@ -13,5 +13,6 @@ class BasicTest extends TestCase
|
||||
public function testExample()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\User;
|
||||
|
||||
/**
|
||||
* Class TestCase
|
||||
@@ -27,6 +28,23 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
return $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return User::find(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
*/
|
||||
public function emptyUser()
|
||||
{
|
||||
return User::find(2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
|
||||
28
tests/acceptance/Controllers/HomeControllerTest.php
Normal file
28
tests/acceptance/Controllers/HomeControllerTest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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.
|
||||
*/
|
||||
class HomeControllerTest extends TestCase
|
||||
{
|
||||
public function testDateRange()
|
||||
{
|
||||
|
||||
$this->be($this->user());
|
||||
|
||||
$args = [
|
||||
'start' => '2012-01-01',
|
||||
'end' => '2012-04-01',
|
||||
];
|
||||
|
||||
// if date range is > 50, should have flash.
|
||||
$response = $this->call('POST', '/daterange', $args);
|
||||
$this->assertEquals(200, $response->status());
|
||||
$this->assertSessionHas('warning', '91 days of data may take a while to load.');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user