Remove unused code.

This commit is contained in:
James Cole
2019-09-03 15:43:11 +02:00
parent 5a8146aa34
commit 401086b75f
7 changed files with 2 additions and 673 deletions

View File

@@ -24,7 +24,6 @@ namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Models\BudgetLimit;
@@ -60,7 +59,6 @@ class BudgetReportControllerTest extends TestCase
{
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
@@ -69,12 +67,6 @@ class BudgetReportControllerTest extends TestCase
// mock default session
$this->mockDefaultSession();
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setBudgets')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'account'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -89,7 +81,6 @@ class BudgetReportControllerTest extends TestCase
{
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
@@ -99,12 +90,6 @@ class BudgetReportControllerTest extends TestCase
$this->mockDefaultSession();
//Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setBudgets')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'budget'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -114,6 +99,7 @@ class BudgetReportControllerTest extends TestCase
/**
* TODO something in this method makes it return a 404.
*
* @covers \FireflyIII\Http\Controllers\Chart\BudgetReportController
*/
public function testMainChart(): void

View File

@@ -24,7 +24,6 @@ namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Models\TransactionType;
@@ -56,7 +55,6 @@ class CategoryReportControllerTest extends TestCase
public function testAccountExpense(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
@@ -65,12 +63,6 @@ class CategoryReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setCategories')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'account'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -84,7 +76,6 @@ class CategoryReportControllerTest extends TestCase
public function testAccountIncome(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
@@ -93,12 +84,6 @@ class CategoryReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setCategories')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['income', 'account'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -112,7 +97,6 @@ class CategoryReportControllerTest extends TestCase
public function testCategoryExpense(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
@@ -121,12 +105,6 @@ class CategoryReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setCategories')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'category'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -140,7 +118,6 @@ class CategoryReportControllerTest extends TestCase
public function testCategoryIncome(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$fiscalHelper = $this->mock(FiscalHelperInterface::class);
$date = new Carbon;
@@ -149,12 +126,6 @@ class CategoryReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setCategories')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['income', 'category'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());

View File

@@ -24,7 +24,6 @@ namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
use FireflyIII\Models\Preference;
@@ -59,7 +58,6 @@ class TagReportControllerTest extends TestCase
public function testAccountExpense(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$tag = $this->user()->tags()->first();
@@ -74,12 +72,6 @@ class TagReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setTags')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'account'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -95,7 +87,6 @@ class TagReportControllerTest extends TestCase
public function testAccountIncome(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$tag = $this->user()->tags()->first();
@@ -109,12 +100,6 @@ class TagReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setTags')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['income', 'account'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -129,7 +114,6 @@ class TagReportControllerTest extends TestCase
public function testBudgetExpense(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$tag = $this->user()->tags()->first();
@@ -143,12 +127,6 @@ class TagReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setTags')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'budget'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -162,7 +140,6 @@ class TagReportControllerTest extends TestCase
public function testCategoryExpense(): void
{
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$tag = $this->user()->tags()->first();
@@ -176,12 +153,6 @@ class TagReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setTags')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'category'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -238,7 +209,6 @@ class TagReportControllerTest extends TestCase
{
$this->mockDefaultSession();
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$this->mock(AccountRepositoryInterface::class);
$tag = $this->user()->tags()->first();
@@ -250,13 +220,6 @@ class TagReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setTags')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['expense', 'tag'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());
@@ -271,7 +234,6 @@ class TagReportControllerTest extends TestCase
{
$this->mockDefaultSession();
$generator = $this->mock(GeneratorInterface::class);
$pieChart = $this->mock(MetaPieChartInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$tag = $this->user()->tags()->first();
@@ -283,13 +245,6 @@ class TagReportControllerTest extends TestCase
$fiscalHelper->shouldReceive('endOfFiscalYear')->atLeast()->once()->andReturn($date);
$fiscalHelper->shouldReceive('startOfFiscalYear')->atLeast()->once()->andReturn($date);
$pieChart->shouldReceive('setAccounts')->once()->andReturnSelf();
$pieChart->shouldReceive('setTags')->once()->andReturnSelf();
$pieChart->shouldReceive('setStart')->once()->andReturnSelf();
$pieChart->shouldReceive('setEnd')->once()->andReturnSelf();
$pieChart->shouldReceive('setCollectOtherObjects')->once()->andReturnSelf()->withArgs([false]);
$pieChart->shouldReceive('generate')->withArgs(['income', 'tag'])->andReturn([])->once();
$generator->shouldReceive('pieChart')->andReturn([])->once();
$this->be($this->user());