@@ -280,7 +280,7 @@ public function testInsertDocumentUrl(): void
280280 $ insertDocumentResponse = $ this ->bbb ->insertDocument ($ insertDocumentParameters );
281281
282282 // ASSERT
283- if (!array_search (Feature::PRESENTATION , $ createMeetingParameters-> getDisabledFeatures ()) > 0 ) {
283+ if (!$ this -> isFeatureDisabled (Feature::PRESENTATION , $ createMeetingParameters) ) {
284284 $ this ->assertTrue ($ insertDocumentResponse ->success ());
285285 } else {
286286 $ this ->assertTrue ($ insertDocumentResponse ->failed ());
@@ -309,9 +309,7 @@ public function testInsertDocumentFile(): void
309309 $ insertDocumentResponse = $ this ->bbb ->insertDocument ($ insertDocumentParameters );
310310
311311 // ASSERT
312- if (!in_array (Feature::PRESENTATION , $ createMeetingParameters ->getDisabledFeatures ())
313- || in_array (Feature::PRESENTATION , $ createMeetingParameters ->getDisabledFeaturesExclude ())
314- ) {
312+ if (!$ this ->isFeatureDisabled (Feature::PRESENTATION , $ createMeetingParameters )) {
315313 $ this ->assertTrue ($ insertDocumentResponse ->success ());
316314 } else {
317315 $ this ->assertTrue ($ insertDocumentResponse ->failed ());
@@ -349,7 +347,7 @@ public function testInsertDocumentUrlAndFile(): void
349347 $ insertDocumentResponse = $ this ->bbb ->insertDocument ($ insertDocumentParameters );
350348
351349 // ASSERT
352- if (!array_search (Feature::PRESENTATION , $ createMeetingParameters-> getDisabledFeatures ()) > 0 ) {
350+ if (!$ this -> isFeatureDisabled (Feature::PRESENTATION , $ createMeetingParameters) ) {
353351 $ this ->assertTrue ($ insertDocumentResponse ->success ());
354352 } else {
355353 $ this ->assertTrue ($ insertDocumentResponse ->failed ());
@@ -633,4 +631,13 @@ public function testHooksDestroy(): void
633631 $ hooksCreateResponse = $ this ->bbb ->hooksDestroy ($ hooksDestroyParameters );
634632 $ this ->assertFalse ($ hooksCreateResponse ->success (), $ hooksCreateResponse ->getMessage ());
635633 }
634+
635+ /**
636+ * Checks whether a feature is disabled in meeting parameters.
637+ */
638+ protected function isFeatureDisabled (Feature $ feature , CreateMeetingParameters $ createMeetingParameters ): bool
639+ {
640+ return in_array ($ feature , $ createMeetingParameters ->getDisabledFeatures ())
641+ && !in_array ($ feature , $ createMeetingParameters ->getDisabledFeaturesExclude ());
642+ }
636643}
0 commit comments