diff --git a/php/tests/ProFileGeneratorTest.php b/php/tests/ProFileGeneratorTest.php index 5b3c29e..641a1f7 100644 --- a/php/tests/ProFileGeneratorTest.php +++ b/php/tests/ProFileGeneratorTest.php @@ -781,8 +781,16 @@ class ProFileGeneratorTest extends TestCase // Navigate to the first slide's media action $cue = $song->getPresentation()->getCues()[0]; - $action = $cue->getActions()[0]; // media action - $url = $action->getMedia()->getElement()->getUrl(); + $mediaAction = null; + foreach ($cue->getActions() as $action) { + if ($action->getType() === 2) { // ACTION_TYPE_MEDIA = 2 + $mediaAction = $action; + break; + } + } + $this->assertNotNull($mediaAction); + + $url = $mediaAction->getMedia()->getElement()->getUrl(); $this->assertNotNull($url); $this->assertNotNull($url->getLocal()); @@ -815,8 +823,16 @@ class ProFileGeneratorTest extends TestCase // Navigate to the first slide's media action $cue = $song->getPresentation()->getCues()[0]; - $action = $cue->getActions()[0]; // media action - $url = $action->getMedia()->getElement()->getUrl(); + $mediaAction = null; + foreach ($cue->getActions() as $action) { + if ($action->getType() === 2) { // ACTION_TYPE_MEDIA = 2 + $mediaAction = $action; + break; + } + } + $this->assertNotNull($mediaAction); + + $url = $mediaAction->getMedia()->getElement()->getUrl(); $this->assertNotNull($url); $this->assertNotNull($url->getLocal()); @@ -849,8 +865,16 @@ class ProFileGeneratorTest extends TestCase // Navigate to the first slide's media action $cue = $song->getPresentation()->getCues()[0]; - $action = $cue->getActions()[0]; // media action - $url = $action->getMedia()->getElement()->getUrl(); + $mediaAction = null; + foreach ($cue->getActions() as $action) { + if ($action->getType() === 2) { // ACTION_TYPE_MEDIA = 2 + $mediaAction = $action; + break; + } + } + $this->assertNotNull($mediaAction); + + $url = $mediaAction->getMedia()->getElement()->getUrl(); $this->assertNotNull($url); $this->assertNotNull($url->getLocal());