From b685c656dfba5eb2af5cfb82e78c32aa5164b866 Mon Sep 17 00:00:00 2001 From: Kyrch Date: Sun, 8 Feb 2026 20:58:11 -0300 Subject: [PATCH] tests: fix video tags unit tests (#1088) --- app/Models/Wiki/Video.php | 2 +- tests/Unit/Models/Wiki/VideoTest.php | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Models/Wiki/Video.php b/app/Models/Wiki/Video.php index b84504165..f3cf27eb8 100644 --- a/app/Models/Wiki/Video.php +++ b/app/Models/Wiki/Video.php @@ -57,7 +57,7 @@ use OwenIt\Auditing\Contracts\Auditable; * @property int $size * @property VideoSource|null $source * @property bool $subbed - * @property array $tags + * @property string $tags * @property bool $uncen * @property int $video_id * diff --git a/tests/Unit/Models/Wiki/VideoTest.php b/tests/Unit/Models/Wiki/VideoTest.php index 7543190c3..ba91a930e 100644 --- a/tests/Unit/Models/Wiki/VideoTest.php +++ b/tests/Unit/Models/Wiki/VideoTest.php @@ -80,7 +80,7 @@ test('nc tag', function () { Video::ATTRIBUTE_NC => true, ]); - $this->assertContains('NC', $video->tags); + $this->assertStringContainsString('NC', $video->tags); }); test('no nc tag', function () { @@ -88,7 +88,7 @@ test('no nc tag', function () { Video::ATTRIBUTE_NC => false, ]); - $this->assertNotContains('NC', $video->tags); + $this->assertStringNotContainsString('NC', $video->tags); }); test('dvd tag', function () { @@ -98,7 +98,7 @@ test('dvd tag', function () { Video::ATTRIBUTE_SOURCE => $source->value, ]); - $this->assertContains($source->localize(), $video->tags); + $this->assertStringContainsString($source->localize(), $video->tags); }); test('bd tag', function () { @@ -108,7 +108,7 @@ test('bd tag', function () { Video::ATTRIBUTE_SOURCE => $source->value, ]); - $this->assertContains($source->localize(), $video->tags); + $this->assertStringContainsString($source->localize(), $video->tags); }); test('other source tag', function () { @@ -124,13 +124,13 @@ test('other source tag', function () { Video::ATTRIBUTE_SOURCE => $source->value, ]); - $this->assertNotContains($source->localize(), $video->tags); + $this->assertStringNotContainsString($source->localize(), $video->tags); }); test('resolution tag', function () { $video = Video::factory()->createOne(); - $this->assertContains(strval($video->resolution), $video->tags); + $this->assertStringContainsString(strval($video->resolution), $video->tags); }); test('no720 resolution tag', function () { @@ -138,7 +138,7 @@ test('no720 resolution tag', function () { Video::ATTRIBUTE_RESOLUTION => 720, ]); - $this->assertNotContains(strval($video->resolution), $video->tags); + $this->assertStringNotContainsString(strval($video->resolution), $video->tags); }); test('subbed tag', function () { @@ -146,8 +146,8 @@ test('subbed tag', function () { Video::ATTRIBUTE_SUBBED => true, ]); - $this->assertContains('Subbed', $video->tags); - $this->assertNotContains('Lyrics', $video->tags); + $this->assertStringContainsString('Subbed', $video->tags); + $this->assertStringNotContainsString('Lyrics', $video->tags); }); test('lyrics tag', function () { @@ -156,8 +156,8 @@ test('lyrics tag', function () { Video::ATTRIBUTE_LYRICS => true, ]); - $this->assertNotContains('Subbed', $video->tags); - $this->assertContains('Lyrics', $video->tags); + $this->assertStringNotContainsString('Subbed', $video->tags); + $this->assertStringContainsString('Lyrics', $video->tags); }); test('source priority', function (array $a, array $b) {