mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-03 04:00:40 -06:00
Expand test coverage
This commit is contained in:
parent
f6096339cb
commit
f85bdcebaf
@ -443,7 +443,7 @@ class SingleController extends Controller
|
||||
foreach ($accounts as $account) {
|
||||
$type = $account->getMeta('accountRole');
|
||||
if (0 === strlen($type)) {
|
||||
$type = 'no_account_type';
|
||||
$type = 'no_account_type'; // @codeCoverageIgnore
|
||||
}
|
||||
$key = strval(trans('firefly.opt_group_' . $type));
|
||||
$return[$key][$account->id] = $account->name;
|
||||
@ -463,7 +463,7 @@ class SingleController extends Controller
|
||||
foreach ($accounts as $account) {
|
||||
$type = $account->getMeta('accountRole');
|
||||
if (0 === strlen($type)) {
|
||||
$type = 'no_account_type';
|
||||
$type = 'no_account_type'; // @codeCoverageIgnore
|
||||
}
|
||||
$key = strval(trans('firefly.opt_group_' . $type));
|
||||
$return[$key][$account->id] = $account->name;
|
||||
@ -482,7 +482,7 @@ class SingleController extends Controller
|
||||
$count = $this->repository->countTransactions($journal);
|
||||
|
||||
if ($count > 2) {
|
||||
return true;
|
||||
return true; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -75,9 +75,10 @@ class SingleControllerTest extends TestCase
|
||||
*/
|
||||
public function testCreate()
|
||||
{
|
||||
$accounts = $this->user()->accounts()->where('account_type_id',3)->get();
|
||||
Steam::shouldReceive('phpBytes')->andReturn(2048);
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$repository->shouldReceive('getActiveAccountsByType')->once()->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn(new Collection);
|
||||
$repository->shouldReceive('getActiveAccountsByType')->once()->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn($accounts);
|
||||
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
|
||||
$budgetRepos->shouldReceive('getActiveBudgets')->andReturn(new Collection)->once();
|
||||
$piggyRepos = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
@ -124,6 +125,7 @@ class SingleControllerTest extends TestCase
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit
|
||||
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedAccountList
|
||||
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::isSplitJournal
|
||||
*/
|
||||
public function testEdit()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user