/** @test */ function it_adds_child_media() { $image = Image::create(['extension' => 'jpg', 'mimetype' => 'image/jpeg', 'size' => 1000, 'name' => 'test', 'path' => 'root/test.jpg']); $media = Media::create(['extension' => 'tst', 'mimetype' => 'test/testy', 'size' => 1000, 'name' => 'test', 'path' => 'root/test.tst']); $directory = Directory::create(['name' => 'parent']); $directory->contain($image); $directory->contain($media); $this->assertNotNull($directory->getContainedMedia()->find($image->getKey())); $this->assertNotNull($directory->getContainedMedia()->find($media->getKey())); }