From eba1cb14105c64169eb8eb49e191752bfb1a764a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 14:52:54 +0100 Subject: [PATCH 01/11] Optional YT --- src/Services/WebinarService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Services/WebinarService.php b/src/Services/WebinarService.php index a58f3b2..deca9cf 100644 --- a/src/Services/WebinarService.php +++ b/src/Services/WebinarService.php @@ -335,11 +335,14 @@ private function canGenerateJitsi(Webinar $webinar): bool $now = now(); $endDate = $this->getWebinarEndDate($webinar); $activeTo = $webinar->active_to ? Carbon::make($webinar->active_to) : null; - return $webinar->isPublished() && + $baseConditions = $webinar->isPublished() && $endDate && ($activeTo && $now->getTimestamp() >= $activeTo->getTimestamp()) && - $now->getTimestamp() <= $endDate->getTimestamp() && - $webinar->hasYT(); + $now->getTimestamp() <= $endDate->getTimestamp(); + + $ytConditions = !$this->youtubeServiceContract->isConfigured() || $this->hasYT($webinar); + + return $baseConditions && $ytConditions; } /** From f8a8bfd63b572bf2d42b47363274d2c4064887b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 15:05:21 +0100 Subject: [PATCH 02/11] fix --- .github/workflows/test-cc.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-cc.yml b/.github/workflows/test-cc.yml index ddf672e..ffc06cd 100644 --- a/.github/workflows/test-cc.yml +++ b/.github/workflows/test-cc.yml @@ -55,19 +55,19 @@ jobs: - name: codecov upload uses: codecov/codecov-action@v1 - - name: Setup Code Climate test-reporter - run: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - - name: SafeDirFix - run: git config --global safe.directory '*' - - - name: Convert - run: ./cc-test-reporter format-coverage coverage.xml -t clover -o codeclimate.0.json - - - name: Upload - run: ./cc-test-reporter upload-coverage -i codeclimate.0.json - env: - CC_TEST_REPORTER_ID: 915c317f6988c594001f3f74d7e1b1c919c04fde6ff24421291c6f0f2a345ab0 +# - name: Setup Code Climate test-reporter +# run: | +# curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter +# chmod +x ./cc-test-reporter +# +# - name: SafeDirFix +# run: git config --global safe.directory '*' +# +# - name: Convert +# run: ./cc-test-reporter format-coverage coverage.xml -t clover -o codeclimate.0.json +# +# - name: Upload +# run: ./cc-test-reporter upload-coverage -i codeclimate.0.json +# env: +# CC_TEST_REPORTER_ID: 915c317f6988c594001f3f74d7e1b1c919c04fde6ff24421291c6f0f2a345ab0 From bf0cd36657ec5ed8b4aa35a5427acb7167a23237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 15:17:01 +0100 Subject: [PATCH 03/11] Added redis --- src/Enum/ConstantEnum.php | 2 ++ src/Services/WebinarService.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/Enum/ConstantEnum.php b/src/Enum/ConstantEnum.php index be651f7..45a8a6c 100644 --- a/src/Enum/ConstantEnum.php +++ b/src/Enum/ConstantEnum.php @@ -8,4 +8,6 @@ class ConstantEnum extends Enum { public const PER_PAGE = 15; public const DIRECTORY = 'webinar'; + public const REDIS_IMAGES_KEY = 'signed_urls_index'; + public const REDIS_IMAGES_TTL = 90; } diff --git a/src/Services/WebinarService.php b/src/Services/WebinarService.php index b81b6c1..28dfae3 100644 --- a/src/Services/WebinarService.php +++ b/src/Services/WebinarService.php @@ -25,6 +25,7 @@ use EscolaLms\Youtube\Services\Contracts\YoutubeServiceContract; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Redis; use Illuminate\Support\Facades\Storage; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -385,6 +386,13 @@ public function generateSignedScreenUrls(GenerateSignedScreenUrlsDto $dto): arra return array_map(function ($file) use ($directory) { $filename = $file['filename']; + if (config('cache.default') === 'redis') { + $key = 'signed_urls:' . md5($directory . $filename); + Redis::command('SETEX', [$key, ConstantEnum::REDIS_IMAGES_TTL, $directory . $filename]); + Redis::command('HSET', [ConstantEnum::REDIS_IMAGES_KEY, $key, 1]); + Redis::command('EXPIRE', [ConstantEnum::REDIS_IMAGES_KEY, ConstantEnum::REDIS_IMAGES_TTL]); + } + return array_merge( ['filename' => $filename], Storage::temporaryUploadUrl($directory . $filename, now()->addMinutes(5)) From 8163c64a6fc3555aa929ea176b114d016991536a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 15:35:29 +0100 Subject: [PATCH 04/11] fix tests --- tests/APIs/WebinarApiTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/APIs/WebinarApiTest.php b/tests/APIs/WebinarApiTest.php index 80b9885..eebe414 100644 --- a/tests/APIs/WebinarApiTest.php +++ b/tests/APIs/WebinarApiTest.php @@ -56,6 +56,7 @@ public function testWebinarsList(): void public function testWebinarsListWithFilter(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $filterData = [ 'name=' . $this->webinar->name, @@ -75,6 +76,7 @@ public function testWebinarsListWithFilter(): void public function testWebinarsListWithSorts(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $testWebinar = Webinar::factory()->create([ @@ -182,6 +184,7 @@ public function testWebinarsListForApi(): void public function testWebinarsListWithFilterForApi(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $filterData = [ 'name=' . $this->webinar->name, @@ -201,6 +204,7 @@ public function testWebinarsListWithFilterForApi(): void public function testWebinarsListWithOrderForApi(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); Webinar::query()->delete(); @@ -253,6 +257,7 @@ public function testWebinarsListWithOrderForApi(): void public function testWebinarsListWithFilterOnlyIncomingForApi(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $this->webinar->update([ From 4ab7565dfe2be07dd568f90fb4abd16c9df78f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 15:39:40 +0100 Subject: [PATCH 05/11] more fixes --- tests/APIs/WebinarListForUserTest.php | 2 ++ tests/APIs/WebinarShowApiTest.php | 2 ++ tests/APIs/WebinarStoreApiTest.php | 1 + 3 files changed, 5 insertions(+) diff --git a/tests/APIs/WebinarListForUserTest.php b/tests/APIs/WebinarListForUserTest.php index 4f03f83..13f75fc 100644 --- a/tests/APIs/WebinarListForUserTest.php +++ b/tests/APIs/WebinarListForUserTest.php @@ -43,6 +43,7 @@ private function initVariable(): void public function testWebinarListForUser(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $this->initVariable(); $this->response = $this->actingAs($this->user, 'api')->json('GET', $this->apiUrl); @@ -91,6 +92,7 @@ public function durationProvider(): array public function testWebinarListOnlyIncoming(string $duration): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $student = User::factory()->create(); diff --git a/tests/APIs/WebinarShowApiTest.php b/tests/APIs/WebinarShowApiTest.php index 5e78554..df20bd5 100644 --- a/tests/APIs/WebinarShowApiTest.php +++ b/tests/APIs/WebinarShowApiTest.php @@ -37,6 +37,7 @@ public function testWebinarShowUnauthorized(): void public function testWebinarShow(): void { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $response = $this->actingAs($this->user, 'api')->json( 'GET', @@ -55,6 +56,7 @@ public function testWebinarShow(): void public function testConsultationShowAPI() { $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); $response = $this->actingAs($this->user, 'api')->json( 'GET', diff --git a/tests/APIs/WebinarStoreApiTest.php b/tests/APIs/WebinarStoreApiTest.php index 211e714..f4c08e6 100644 --- a/tests/APIs/WebinarStoreApiTest.php +++ b/tests/APIs/WebinarStoreApiTest.php @@ -57,6 +57,7 @@ public function testWebinarStore(): void $ytLiveDtoMock = new YTLiveDtoMock(); $youtubeServiceContract = $this->mock(YoutubeServiceContract::class); + $youtubeServiceContract->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $youtubeServiceContract->shouldReceive('generateYTStream')->once()->andReturn($ytLiveDtoMock); $youtubeServiceContract->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect([1])); From 1fb75eca15f99394fcbf9e2a52aae596b7b1c02c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 15:45:10 +0100 Subject: [PATCH 06/11] fix --- tests/APIs/WebinarDestroyApiTest.php | 1 + tests/APIs/WebinarGenerateJitsiTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/APIs/WebinarDestroyApiTest.php b/tests/APIs/WebinarDestroyApiTest.php index 9704a06..1c03d48 100644 --- a/tests/APIs/WebinarDestroyApiTest.php +++ b/tests/APIs/WebinarDestroyApiTest.php @@ -42,6 +42,7 @@ public function testWebinarDestroy(): void { $this->initVariable(); $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('getYtLiveStream')->once()->andReturn(collect()); $response = $this->actingAs($this->user, 'api')->json( 'DELETE', diff --git a/tests/APIs/WebinarGenerateJitsiTest.php b/tests/APIs/WebinarGenerateJitsiTest.php index e63d964..f16d918 100644 --- a/tests/APIs/WebinarGenerateJitsiTest.php +++ b/tests/APIs/WebinarGenerateJitsiTest.php @@ -37,6 +37,7 @@ public function testGenerateJitsiUnAuthorized(): void public function testGenerateJitsiWithWebinar(): void { $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('getYtLiveStream')->once()->andReturn(collect(['s'])); $this->webinar = Webinar::factory([ 'status' => WebinarStatusEnum::PUBLISHED, From da2fac63f2d5af7bc442bbc45ceafbd9c11fd390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 15:59:13 +0100 Subject: [PATCH 07/11] Fix --- tests/APIs/WebinarApiTest.php | 3 +++ tests/APIs/WebinarUpdateApiTest.php | 4 ++++ tests/TestCase.php | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/tests/APIs/WebinarApiTest.php b/tests/APIs/WebinarApiTest.php index eebe414..99125fe 100644 --- a/tests/APIs/WebinarApiTest.php +++ b/tests/APIs/WebinarApiTest.php @@ -48,6 +48,7 @@ protected function setUp(): void public function testWebinarsList(): void { $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect()); $this->response = $this->actingAs($this->user, 'api')->get('/api/admin/webinars'); $this->response->assertOk(); @@ -176,6 +177,7 @@ public function testWebinarsListUnauthorized(): void public function testWebinarsListForApi(): void { $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect()); $this->response = $this->get('/api/webinars'); $this->response->assertOk(); @@ -383,6 +385,7 @@ public function testWebinarAssignableUsersSearch(): void public function testWebinarListOwn(): void { $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect()); Webinar::factory()->count(3)->create(); diff --git a/tests/APIs/WebinarUpdateApiTest.php b/tests/APIs/WebinarUpdateApiTest.php index 6d87274..e7cd2fe 100644 --- a/tests/APIs/WebinarUpdateApiTest.php +++ b/tests/APIs/WebinarUpdateApiTest.php @@ -60,6 +60,7 @@ public function testWebinarUpdate(): void ); $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); @@ -117,6 +118,7 @@ public function testWebinarClearTagsUpdate(): void ); $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); @@ -155,6 +157,7 @@ public function testWebinarUpdateTrainers(): void $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); @@ -203,6 +206,7 @@ public function testWebinarUpdateImageAndLogotypeFromExistingFiles(): void $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); + $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); diff --git a/tests/TestCase.php b/tests/TestCase.php index 18355a1..4b0fb65 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -21,6 +21,15 @@ class TestCase extends \EscolaLms\Core\Tests\TestCase protected function setUp(): void { parent::setUp(); + + config([ + 'services.youtube.client_id' => 'test_client_id', + 'services.youtube.client_secret' => 'test_secret', + 'services.youtube.api_key' => 'test_api_key', + 'services.youtube.refresh_token' => 'test_refresh_token', + 'services.youtube.redirect_url' => 'redirect_url', + ]); + Passport::useClientModel(Client::class); } From 48a5e37d99bb22e681269572e0f9de28feb5d214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Tue, 24 Mar 2026 16:21:20 +0100 Subject: [PATCH 08/11] fix --- tests/APIs/WebinarApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/APIs/WebinarApiTest.php b/tests/APIs/WebinarApiTest.php index 99125fe..76d3a56 100644 --- a/tests/APIs/WebinarApiTest.php +++ b/tests/APIs/WebinarApiTest.php @@ -385,7 +385,7 @@ public function testWebinarAssignableUsersSearch(): void public function testWebinarListOwn(): void { $webinarService = $this->mock(YoutubeServiceContract::class); - $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(false); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect()); Webinar::factory()->count(3)->create(); From 722482466fb2d74c1268c54b2f8c76ae6282e836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Wed, 25 Mar 2026 07:11:28 +0100 Subject: [PATCH 09/11] Fix --- src/Services/WebinarService.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Services/WebinarService.php b/src/Services/WebinarService.php index 28dfae3..825843a 100644 --- a/src/Services/WebinarService.php +++ b/src/Services/WebinarService.php @@ -343,9 +343,11 @@ private function canGenerateJitsi(Webinar $webinar): bool ($activeTo && $now->getTimestamp() >= $activeTo->getTimestamp()) && $now->getTimestamp() <= $endDate->getTimestamp(); - $ytConditions = !$this->youtubeServiceContract->isConfigured() || $this->hasYT($webinar); + if (!$baseConditions) { + return false; + } - return $baseConditions && $ytConditions; + return !$this->youtubeServiceContract->isConfigured() || $this->hasYT($webinar); } /** From 02dbb9bec99b732293e5893e19a8dbc0e320c261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Wed, 25 Mar 2026 07:20:02 +0100 Subject: [PATCH 10/11] Fix --- tests/APIs/WebinarUpdateApiTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/APIs/WebinarUpdateApiTest.php b/tests/APIs/WebinarUpdateApiTest.php index e7cd2fe..0222b54 100644 --- a/tests/APIs/WebinarUpdateApiTest.php +++ b/tests/APIs/WebinarUpdateApiTest.php @@ -60,7 +60,7 @@ public function testWebinarUpdate(): void ); $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); - $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); @@ -118,7 +118,7 @@ public function testWebinarClearTagsUpdate(): void ); $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); - $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); @@ -157,7 +157,7 @@ public function testWebinarUpdateTrainers(): void $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); - $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); @@ -206,7 +206,7 @@ public function testWebinarUpdateImageAndLogotypeFromExistingFiles(): void $ytLiveDtoMock = new YTLiveDtoMock(); $webinarService = $this->mock(YoutubeServiceContract::class); - $webinarService->shouldReceive('isConfigured')->once()->andReturn(true); + $webinarService->shouldReceive('isConfigured')->zeroOrMoreTimes()->andReturn(true); $webinarService->shouldReceive('updateYTStream')->zeroOrMoreTimes()->andReturn($ytLiveDtoMock); $webinarService->shouldReceive('getYtLiveStream')->zeroOrMoreTimes()->andReturn(collect(['s'])); From 856ece9d57988a50f1261160b8999cd631daa792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Wed, 25 Mar 2026 07:33:32 +0100 Subject: [PATCH 11/11] fix? --- src/Services/WebinarService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/WebinarService.php b/src/Services/WebinarService.php index 825843a..097e7d8 100644 --- a/src/Services/WebinarService.php +++ b/src/Services/WebinarService.php @@ -347,7 +347,7 @@ private function canGenerateJitsi(Webinar $webinar): bool return false; } - return !$this->youtubeServiceContract->isConfigured() || $this->hasYT($webinar); + return !$this->youtubeServiceContract->isConfigured() || $webinar->hasYT(); } /**