/ tests / Services / FolderServiceTest.php
FolderServiceTest.php
 1  <?php
 2  
 3  namespace Tests\Services;
 4  
 5  use App\Http\Services\FolderService;
 6  use App\Models\Dossier;
 7  use App\Models\Folder;
 8  
 9  class FolderServiceTest extends \Tests\TestCase
10  {
11  
12      public function testCreateStructureArray()
13      {
14          $this->markTestSkipped('unused');
15      }
16  
17      public function testCreate()
18      {
19          $this->actingAs($this->getAdminUser());
20  
21          $dossier = Dossier::factory()->create();
22  
23          //Creating a Folder requires a parent folder
24          $parentFolder = Folder::factory()->create();
25  
26          $this->assertInstanceOf(Folder::class, FolderService::create([
27              'name' => uniqid(),
28              'dossier_id' => $dossier->id,
29              'parent_id' => $parentFolder->id,
30          ]));
31      }
32  }