mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
Fixed some tests so they will not be skipped.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
* This software may be modified and distributed under the terms
|
||||
* of the MIT license. See the LICENSE file for details.
|
||||
*/
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Generated by PHPUnit_SkeletonGenerator on 2016-01-19 at 15:39:57.
|
||||
@@ -40,10 +41,14 @@ class ChartCategoryControllerTest extends TestCase
|
||||
*/
|
||||
public function testEarnedInPeriod()
|
||||
{
|
||||
// $this->be($this->user());
|
||||
// $response = $this->call('GET', '/chart/category/earned-in-period/default/20150101/20151231/1');
|
||||
// $this->assertEquals(200, $response->status());
|
||||
$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.');
|
||||
$repository = Mockery::mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||
$repository->shouldReceive('earnedForAccountsPerMonth')->once()->andReturn(new Collection);
|
||||
|
||||
$this->app->instance('FireflyIII\Repositories\Category\CategoryRepositoryInterface', $repository);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->call('GET', '/chart/category/earned-in-period/default/20150101/20151231/1');
|
||||
$this->assertEquals(200, $response->status());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,10 +56,16 @@ class ChartCategoryControllerTest extends TestCase
|
||||
*/
|
||||
public function testFrontpage()
|
||||
{
|
||||
// $this->be($this->user());
|
||||
// $response = $this->call('GET', '/chart/category/frontpage');
|
||||
// $this->assertEquals(200, $response->status());
|
||||
$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.');
|
||||
$repository = Mockery::mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||
$repository->shouldReceive('spentForAccountsPerMonth')->once()->andReturn(new Collection);
|
||||
$repository->shouldReceive('sumSpentNoCategory')->once()->andReturn('120');
|
||||
|
||||
$this->app->instance('FireflyIII\Repositories\Category\CategoryRepositoryInterface', $repository);
|
||||
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->call('GET', '/chart/category/frontpage');
|
||||
$this->assertEquals(200, $response->status());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,10 +73,14 @@ class ChartCategoryControllerTest extends TestCase
|
||||
*/
|
||||
public function testMultiYear()
|
||||
{
|
||||
// $this->be($this->user());
|
||||
// $response = $this->call('GET', '/chart/category/multi-year/default/20150101/20151231/1/1');
|
||||
// $this->assertEquals(200, $response->status());
|
||||
$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.');
|
||||
$repository = Mockery::mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||
$repository->shouldReceive('listMultiYear')->once()->andReturn(new Collection);
|
||||
|
||||
$this->app->instance('FireflyIII\Repositories\Category\CategoryRepositoryInterface', $repository);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->call('GET', '/chart/category/multi-year/default/20150101/20151231/1/1');
|
||||
$this->assertEquals(200, $response->status());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,9 +99,16 @@ class ChartCategoryControllerTest extends TestCase
|
||||
*/
|
||||
public function testSpentInPeriod()
|
||||
{
|
||||
// $this->be($this->user());
|
||||
// $response = $this->call('GET', '/chart/category/spent-in-period/default/20150101/20151231/1');
|
||||
// $this->assertEquals(200, $response->status());
|
||||
$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.');
|
||||
|
||||
|
||||
$repository = Mockery::mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||
$repository->shouldReceive('spentForAccountsPerMonth')->once()->andReturn(new Collection);
|
||||
|
||||
$this->app->instance('FireflyIII\Repositories\Category\CategoryRepositoryInterface', $repository);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->call('GET', '/chart/category/spent-in-period/default/20150101/20151231/1');
|
||||
$this->assertEquals(200, $response->status());
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user