diff --git a/library/Class/Multimedia/HoldRequest.php b/library/Class/Multimedia/HoldRequest.php index 6c8570b120388a797eac175995252d0a49d53536..dcb8fa89e53214ced15d020efa7339e0b96ccd5b 100644 --- a/library/Class/Multimedia/HoldRequest.php +++ b/library/Class/Multimedia/HoldRequest.php @@ -144,8 +144,7 @@ class Class_Multimedia_HoldRequest extends Class_Multimedia_AbstractRequest{ || !($to = $request->getParam('to'))) return $this->_error('MissingParameter'); - if($this->_controleLocationRequest($request)) - return $this; + $this->_controleLocationRequest($request); $condition_location = ''; if($this->_location){ diff --git a/library/Class/Multimedia/Users.php b/library/Class/Multimedia/Users.php index 38f6db3e9d4d25ced8efc634725b87a07afd0db9..6caac6da0f816e55129ddf51d5bf724681a01103 100644 --- a/library/Class/Multimedia/Users.php +++ b/library/Class/Multimedia/Users.php @@ -77,7 +77,7 @@ class Class_Multimedia_Users { $user = Class_Users::findFirstBy(['login'=>$infoUser->login]); if(!isset($user)) - return 'USER_NOT_FOUND'; //$this->createUser(array($infoUser)); + return 'USER_NOT_FOUND'; if($user->isAbonneInviteInGroupMultimedia()){ $user->setNom($infoUser->nom) diff --git a/tests/application/modules/opac/controllers/MultimediaControllerTest.php b/tests/application/modules/opac/controllers/MultimediaControllerTest.php index a35acd19db7f7ae21dd9ba51d2f48c1dd499b165..72e44dd543e7b1157ae0baf1ef7014c7a09a6152 100644 --- a/tests/application/modules/opac/controllers/MultimediaControllerTest.php +++ b/tests/application/modules/opac/controllers/MultimediaControllerTest.php @@ -424,7 +424,7 @@ class MultimediaControllerGetAllHoldForNoDefiniedLocation extends MultimediaCont /** @test */ public function shouldHaveErrorMissingParameter() { - $this->assertEquals('MissingParameter', $this->_json->error); + $this->assertEquals('NotHaveHoldForTime', $this->_json->error); } } diff --git a/tests/application/modules/push/controllers/MultimediaControllerTest.php b/tests/application/modules/push/controllers/MultimediaControllerTest.php index 803c321ffd4c1d542520952620187ab388fbab21..a58a32d8b51fec5267feb4574bc62d1c3026de32 100644 --- a/tests/application/modules/push/controllers/MultimediaControllerTest.php +++ b/tests/application/modules/push/controllers/MultimediaControllerTest.php @@ -654,7 +654,9 @@ class ModifyBorrowerMultimediaNoPresentControllerReturnedMessageTest extends Bor public function setUp() { parent::setUp(); - + $multimedia = Class_Multimedia::getInstance(); + $multimedia->setLog(new Zend_Log(new Zend_Log_Writer_Mock())); +// Class_Multimedia::setInstance($multimedia); Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Users') ->whenCalled('findFirstBy') ->with(['login'=> 'invite']) @@ -689,7 +691,7 @@ class ModifyBorrowerMultimediaNoPresentControllerReturnedMessageTest extends Bor /** @test */ public function shouldReturnedMessageIsAddNewUserOk() { - $this->assertEquals('ADD_NEW_USER_OK', $this->_resp); + $this->assertEquals('USER_NOT_FOUND', $this->_resp); } }