Improve some test coverage.

This commit is contained in:
James Cole
2018-01-21 18:06:57 +01:00
parent d5e6d1c578
commit 48fa86cc54
5 changed files with 189 additions and 7 deletions

View File

@@ -112,6 +112,22 @@ class AttachmentHelperTest extends TestCase
Storage::disk('upload')->assertExists(sprintf('at-%d.data', $attachments->first()->id));
}
/**
* Test double file upload. Needs to be after testSave.
*
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::__construct
* @covers \FireflyIII\Helpers\Attachments\AttachmentHelper::saveAttachmentsForModel
*/
public function testSaveEmpty()
{
$journal = TransactionJournal::first();
$helper = new AttachmentHelper;
$res = $helper->saveAttachmentsForModel($journal, null);
$this->assertTrue($res);
}
/**
* Test double file upload. Needs to be after testSave.
*