mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-03 12:47:17 -06:00
Fixed some tests so they will not be skipped.
This commit is contained in:
parent
049d866f62
commit
bf9c1c1875
@ -62,8 +62,13 @@ class ChartBudgetControllerTest extends TestCase
|
||||
public function testMultiYear()
|
||||
{
|
||||
|
||||
$budget = new Budget;
|
||||
$budget->id = 1;
|
||||
$budget->dateFormatted = '2015';
|
||||
$budget->budgeted = 120;
|
||||
|
||||
$repository = Mockery::mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$repository->shouldReceive('getBudgetedPerYear')->once()->andReturn(new Collection);
|
||||
$repository->shouldReceive('getBudgetedPerYear')->once()->andReturn(new Collection([$budget]));
|
||||
$repository->shouldReceive('getBudgetsAndExpensesPerYear')->once()->andReturn([]);
|
||||
|
||||
$this->app->instance('FireflyIII\Repositories\Budget\BudgetRepositoryInterface', $repository);
|
||||
|
@ -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());
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user