diff --git a/VERSIONS_WIP/178962 b/VERSIONS_WIP/178962 new file mode 100644 index 0000000000000000000000000000000000000000..805e415daa27610c03e49d40e2a4b71a81ab9497 --- /dev/null +++ b/VERSIONS_WIP/178962 @@ -0,0 +1 @@ + - hotline #178962 : Connecteur Orphée : Quand un utilisateur est connecté, les exemplaires sur les pages notices ne se chargent plus \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Orphee/Service.php b/library/Class/WebService/SIGB/Orphee/Service.php index 2bdd5fb41b18af7d57c9121bae1990a3956d7e9e..98b83ae5980b69791c03c70f2987d2f584fdad4d 100644 --- a/library/Class/WebService/SIGB/Orphee/Service.php +++ b/library/Class/WebService/SIGB/Orphee/Service.php @@ -71,7 +71,7 @@ class Class_WebService_SIGB_Orphee_Service extends Class_WebService_SIGB_Abstrac public function __destruct() { - if ($this->isConnected()) + if ($this->_session_strategy && $this->isConnected()) $this->disconnect(); } diff --git a/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php b/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php index 8d384044a2ec7936348d113943b69da34093f4d1..0f39ba648e1efce2f0a41d6a9e529cb73eba0518 100644 --- a/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php +++ b/tests/library/Class/WebService/SIGB/OrpheeServiceTest.php @@ -76,6 +76,16 @@ class OrpheeServiceGetServiceTest extends ModelTestCase { } + /** @test */ + function shouldNotRecreateSessionStrategyOnServiceDestruction() { + $orphee = Class_WebService_SIGB_Orphee_Service::getService('tests/fixtures/orphee.wsdl'); + $orphee->setSearchClient($this->_search_client); + unset($orphee); + gc_collect_cycles(); + $this->assertFalse($this->_search_client->methodHasBeenCalled('EndSession')); + } + + /** @test */ public function serviceHoldModeShouldDefaultToHoldTitle() { $orphee = Class_WebService_SIGB_Orphee::getService(['url_serveur' => 'tests/fixtures/orphee.wsdl',