mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 15:39:50 +00:00
Improve code quality and fix test coverage.
This commit is contained in:
@@ -49,7 +49,7 @@ class ExportControllerTest extends TestCase
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Log::debug(sprintf('Now in %s.', get_class($this)));
|
||||
Log::debug(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +60,7 @@ class ExportControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$repository = $this->mock(ExportJobRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$repository->shouldReceive('exists')->once()->andReturn(true);
|
||||
$repository->shouldReceive('getContent')->once()->andReturn('Some content beep boop');
|
||||
@@ -79,7 +79,7 @@ class ExportControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$repository = $this->mock(ExportJobRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$repository->shouldReceive('exists')->once()->andReturn(false);
|
||||
|
||||
@@ -95,7 +95,7 @@ class ExportControllerTest extends TestCase
|
||||
{
|
||||
// mock stuff
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
|
||||
$this->be($this->user());
|
||||
$response = $this->get(route('export.status', ['testExport']));
|
||||
@@ -113,7 +113,7 @@ class ExportControllerTest extends TestCase
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$job = ExportJob::first();
|
||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$repository->shouldReceive('create')->andReturn($job);
|
||||
$repository->shouldReceive('cleanup');
|
||||
$accountRepos->shouldReceive('getAccountsByType')->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn(new Collection);
|
||||
@@ -137,7 +137,7 @@ class ExportControllerTest extends TestCase
|
||||
$processor = $this->mock(ProcessorInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('first')->andReturn(new TransactionJournal);
|
||||
$journalRepos->shouldReceive('firstNull')->andReturn(new TransactionJournal);
|
||||
|
||||
$this->session(
|
||||
['first' => new Carbon('2014-01-01')]
|
||||
|
||||
Reference in New Issue
Block a user