diff --git a/application/modules/opac/controllers/NoticeajaxController.php b/application/modules/opac/controllers/NoticeajaxController.php index 59d66bc2556c30fa22476a942ff7e48f6caeb3e7..2b491f8da4c76fc79fbb26be15442d34eb344d02 100644 --- a/application/modules/opac/controllers/NoticeajaxController.php +++ b/application/modules/opac/controllers/NoticeajaxController.php @@ -294,7 +294,8 @@ class NoticeAjaxController extends Zend_Controller_Action { public function videomorceauAction() { if($this->service_afi > "") { - $args=array("titre" => $_REQUEST["titre"], "auteur" => $_REQUEST["auteur"]); + $args=["titre" => $this->_getParam('titre'), + "auteur" => $this->_getParam('auteur')]; $data=Class_WebService_AllServices::runServiceAfi(9,$args); $source=$data["source"]; $video=$data["video"]; diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php index 053166f99bcd5d0cbe9db08b1165dd2f0f13c716..4977c83cb2a4aecad4aa1e86d9a315d9c87d9ebb 100644 --- a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php +++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php @@ -516,4 +516,23 @@ class NoticeAjaxControllerNoticeActionTest extends AbstractControllerTestCase { } } + + +class NoticeAjaxControllerVideoMorceauTest extends AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/opac/noticeajax/videomorceau?auteur=The%20Beatles&titre=Come%20together', true); + } + + + /** + * @group integration + * @test + */ + public function responseShouldContainsPlayer() { + $this->assertXPath('//param[@name="movie"][@value="http://youtube.googleapis.com/v/axb2sHpGwHQ&source=uds&autoplay=1"]', + $this->_response->getBody()); + } +} + ?> \ No newline at end of file