Skip to content

Commit bae33c2

Browse files
committed
Appease coverage
1 parent ab05434 commit bae33c2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/_support/OutboxTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace Tests\Support;
22

33
use CodeIgniter\Test\CIUnitTestCase;
4+
use CodeIgniter\Test\Mock\MockEmail;
45

56
class OutboxTestCase extends CIUnitTestCase
67
{

tests/models/TemplateModelTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
use CodeIgniter\Test\DatabaseTestTrait;
4+
use Tatter\Outbox\Database\Seeds\TemplateSeeder;
45
use Tatter\Outbox\Entities\Template;
56
use Tatter\Outbox\Exceptions\TemplatesException;
67
use Tatter\Outbox\Models\TemplateModel;
@@ -42,4 +43,20 @@ public function testFindByNameThrowsOnFailure()
4243

4344
model(TemplateModel::class)->findByName('foobar');
4445
}
46+
47+
public function testSeederIgnoresExisting()
48+
{
49+
$this->seed(TemplateSeeder::class);
50+
51+
$this->dontSeeInDatabase('outbox_templates', ['name' => 'Default']);
52+
}
53+
54+
public function testSeederCreatesDefault()
55+
{
56+
model(TemplateModel::class)->truncate();
57+
58+
$this->seed(TemplateSeeder::class);
59+
60+
$this->seeInDatabase('outbox_templates', ['name' => 'Default']);
61+
}
4562
}

0 commit comments

Comments
 (0)