mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix test method names.
This commit is contained in:
@@ -100,41 +100,6 @@ class ShowControllerTest extends TestCase
|
||||
$response->assertSee('<ol class="breadcrumb">');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ShowController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
*/
|
||||
public function testShowLiability(string $range): void
|
||||
{
|
||||
$date = new Carbon;
|
||||
$this->session(['start' => $date, 'end' => clone $date]);
|
||||
$account = $this->user()->accounts()->where('account_type_id', 12)->whereNull('deleted_at')->first();
|
||||
|
||||
// mock stuff:
|
||||
$tasker = $this->mock(AccountTaskerInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
|
||||
$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
|
||||
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$repository->shouldReceive('getMetaValue')->andReturn('');
|
||||
$repository->shouldReceive('isLiability')->andReturn(true);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('accounts.show', [$account->id]));
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirect(route('accounts.show.all', [$account->id]));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ShowController
|
||||
* @dataProvider dateRangeProvider
|
||||
@@ -277,4 +242,38 @@ class ShowControllerTest extends TestCase
|
||||
$response->assertStatus(302);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Http\Controllers\Account\ShowController
|
||||
* @dataProvider dateRangeProvider
|
||||
*
|
||||
* @param string $range
|
||||
*/
|
||||
public function testShowLiability(string $range): void
|
||||
{
|
||||
$date = new Carbon;
|
||||
$this->session(['start' => $date, 'end' => clone $date]);
|
||||
$account = $this->user()->accounts()->where('account_type_id', 12)->whereNull('deleted_at')->first();
|
||||
|
||||
// mock stuff:
|
||||
$tasker = $this->mock(AccountTaskerInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
|
||||
$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
|
||||
|
||||
$repository = $this->mock(AccountRepositoryInterface::class);
|
||||
$repository->shouldReceive('getMetaValue')->andReturn('');
|
||||
$repository->shouldReceive('isLiability')->andReturn(true);
|
||||
|
||||
$this->be($this->user());
|
||||
$this->changeDateRange($this->user(), $range);
|
||||
$response = $this->get(route('accounts.show', [$account->id]));
|
||||
$response->assertStatus(302);
|
||||
$response->assertRedirect(route('accounts.show.all', [$account->id]));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user