mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-03 11:15:04 +02:00
* feat: migrate encoding scripts from github to platform * style: fix StyleCI finding * fix: don't concatenate updated videos when attempting to attach entry on video upload * fix(api): fix field dependencies & feat(admin): upload script from video detail screen
44 lines
902 B
PHP
44 lines
902 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Unit\Models\Wiki\Video;
|
|
|
|
use App\Models\Wiki\Video;
|
|
use App\Models\Wiki\Video\VideoScript;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Tests\TestCase;
|
|
|
|
/**
|
|
* Class ScriptTest.
|
|
*/
|
|
class ScriptTest extends TestCase
|
|
{
|
|
/**
|
|
* Dumps shall be nameable.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testNameable(): void
|
|
{
|
|
$script = VideoScript::factory()->createOne();
|
|
|
|
static::assertIsString($script->getName());
|
|
}
|
|
|
|
/**
|
|
* Scripts shall belong to a Video.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testVideo(): void
|
|
{
|
|
$script = VideoScript::factory()
|
|
->for(Video::factory())
|
|
->createOne();
|
|
|
|
static::assertInstanceOf(BelongsTo::class, $script->video());
|
|
static::assertInstanceOf(Video::class, $script->video()->first());
|
|
}
|
|
}
|