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,7 +37,7 @@ class NotesEmptyTest extends TestCase
*/
public function testTriggered(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal = $this->getRandomWithdrawal();
$journal->notes()->delete();
$trigger = NotesEmpty::makeFromStrings('', false);
$result = $trigger->triggered($journal);
@@ -49,7 +49,7 @@ class NotesEmptyTest extends TestCase
*/
public function testTriggeredEmpty(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal = $this->getRandomWithdrawal();
$journal->notes()->delete();
$note = new Note();
$note->noteable()->associate($journal);
@@ -65,7 +65,7 @@ class NotesEmptyTest extends TestCase
*/
public function testTriggeredPartial(): void
{
$journal = TransactionJournal::inRandomOrder()->whereNull('deleted_at')->first();
$journal = $this->getRandomWithdrawal();
$journal->notes()->delete();
$note = new Note();
$note->noteable()->associate($journal);