/ tests / Unit / ValidationTypeSeederTest.php
ValidationTypeSeederTest.php
 1  <?php
 2  
 3  namespace Tests\Unit;
 4  
 5  use App\Models\Norm;
 6  use Tests\TestCase;
 7  
 8  class ValidationTypeSeederTest extends TestCase
 9  {
10  
11      public function test_norms_exist()
12      {
13          $this->assertDatabaseCount('norms', 2);
14      }
15  
16      public function test_every_norm_has_these_validation_types()
17      {
18          $names = [
19              'InformeValidacionSolicitudCertificacion',
20          ];
21  
22          foreach(Norm::all() as $norm) {
23              foreach($names as $name) {
24                  $this->assertDatabaseHas('validation_types', [
25                      'norm_id' => $norm->id,
26                      'name' => $name,
27                  ]);
28              }
29          }
30      }
31  }