File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
<?php namespace Tests \Support ;
2
2
3
3
use CodeIgniter \Test \CIUnitTestCase ;
4
+ use CodeIgniter \Test \Mock \MockEmail ;
4
5
5
6
class OutboxTestCase extends CIUnitTestCase
6
7
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use CodeIgniter \Test \DatabaseTestTrait ;
4
+ use Tatter \Outbox \Database \Seeds \TemplateSeeder ;
4
5
use Tatter \Outbox \Entities \Template ;
5
6
use Tatter \Outbox \Exceptions \TemplatesException ;
6
7
use Tatter \Outbox \Models \TemplateModel ;
@@ -42,4 +43,20 @@ public function testFindByNameThrowsOnFailure()
42
43
43
44
model (TemplateModel::class)->findByName ('foobar ' );
44
45
}
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
+ }
45
62
}
You can’t perform that action at this time.
0 commit comments