Various code clean up.

This commit is contained in:
James Cole
2017-07-23 08:16:11 +02:00
parent 2c00a8353d
commit 8bb7d5de3f
26 changed files with 138 additions and 149 deletions

View File

@@ -99,10 +99,8 @@ class BudgetControllerTest extends TestCase
*/
public function testExpenseAsset(string $range)
{
$repository = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$catRepos = $this->mock(CategoryRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$transactions = factory(Transaction::class, 10)->make();
$accounts = factory(Account::class, 10)->make();
@@ -132,11 +130,9 @@ class BudgetControllerTest extends TestCase
*/
public function testExpenseCategory(string $range)
{
$repository = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$catRepos = $this->mock(CategoryRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$transactions = factory(Transaction::class, 10)->make();
$categories = factory(Category::class, 10)->make();
@@ -167,16 +163,8 @@ class BudgetControllerTest extends TestCase
*/
public function testExpenseExpense(string $range)
{
$repository = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$catRepos = $this->mock(CategoryRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$repository = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$catRepos = $this->mock(CategoryRepositoryInterface::class);
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$transactions = factory(Transaction::class, 10)->make();
$accounts = factory(Account::class, 10)->make();

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Tests\Feature\Controllers;
use FireflyIII\Support\Search\SearchInterface;
use Illuminate\Support\Collection;
use Tests\TestCase;
/**

View File

@@ -63,9 +63,6 @@ class MetaPieChartTest extends TestCase
// mock all repositories:
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos->shouldReceive('setUser');
$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);
@@ -126,9 +123,6 @@ class MetaPieChartTest extends TestCase
// mock all repositories:
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$categoryRepos = $this->mock(CategoryRepositoryInterface::class);
$tagRepos = $this->mock(TagRepositoryInterface::class);
$accountRepos->shouldReceive('setUser');
$accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);