mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Optimize test code.
This commit is contained in:
@@ -22,16 +22,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called before the first test of this test class is run.
|
|
||||||
*
|
|
||||||
* @since Method available since Release 3.4.0
|
|
||||||
*/
|
|
||||||
public static function setUpBeforeClass()
|
|
||||||
{
|
|
||||||
parent::setUpBeforeClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the fixture, for example, opens a network connection.
|
* Sets up the fixture, for example, opens a network connection.
|
||||||
* This method is called before a test is executed.
|
* This method is called before a test is executed.
|
||||||
@@ -44,7 +34,15 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called before the first test of this test class is run.
|
||||||
|
*
|
||||||
|
* @since Method available since Release 3.4.0
|
||||||
|
*/
|
||||||
|
public static function setUpBeforeClass()
|
||||||
|
{
|
||||||
|
parent::setUpBeforeClass();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $class
|
* @param string $class
|
||||||
@@ -61,5 +59,4 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -25,23 +25,6 @@ class HomeControllerTest extends TestCase
|
|||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
|
|
||||||
*/
|
|
||||||
public function testDateRangeWarning()
|
|
||||||
{
|
|
||||||
$start = '2014-03-01';
|
|
||||||
$end = '2015-03-31';
|
|
||||||
$this->be(new FireflyIII\User);
|
|
||||||
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start,'_token' => 'replaceme']);
|
|
||||||
$this->assertResponseOk();
|
|
||||||
|
|
||||||
$this->assertSessionHas('start');
|
|
||||||
$this->assertSessionHas('end');
|
|
||||||
$this->assertSessionHas('warning');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
|
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
|
||||||
*/
|
*/
|
||||||
@@ -60,6 +43,23 @@ class HomeControllerTest extends TestCase
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Http\Controllers\HomeController::dateRange
|
||||||
|
*/
|
||||||
|
public function testDateRangeWarning()
|
||||||
|
{
|
||||||
|
$start = '2014-03-01';
|
||||||
|
$end = '2015-03-31';
|
||||||
|
$this->be(new FireflyIII\User);
|
||||||
|
$this->call('POST', '/daterange', ['end' => $end, 'start' => $start, '_token' => 'replaceme']);
|
||||||
|
$this->assertResponseOk();
|
||||||
|
|
||||||
|
$this->assertSessionHas('start');
|
||||||
|
$this->assertSessionHas('end');
|
||||||
|
$this->assertSessionHas('warning');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Http\Controllers\HomeController::index
|
* @covers FireflyIII\Http\Controllers\HomeController::index
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user