Improve test coverage.

This commit is contained in:
James Cole
2019-08-01 06:21:44 +02:00
parent 9b574ce7ad
commit b049ca27f1
45 changed files with 336 additions and 251 deletions

View File

@@ -37,8 +37,8 @@ class HasAnyCategoryTest extends TestCase
*/
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$category = $journal->user->categories()->first();
$journal = $this->getRandomWithdrawal();
$category = $this->getRandomCategory();;
$journal->categories()->detach();
$journal->categories()->save($category);
@@ -53,7 +53,7 @@ class HasAnyCategoryTest extends TestCase
*/
public function testTriggeredNot(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal = $this->getRandomWithdrawal();
$journal->categories()->detach();
// also detach transactions: