diff --git a/VERSIONS_HOTLINE/73682 b/VERSIONS_HOTLINE/73682 new file mode 100644 index 0000000000000000000000000000000000000000..8b30b8c51e015d53a4102025cf4c011025529003 --- /dev/null +++ b/VERSIONS_HOTLINE/73682 @@ -0,0 +1 @@ + - ticket #73682 : Inspecteur Gadget : Correction d'une erreur lors du captage des requêtes de webservices SOAP \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Opsys/ServiceFactory.php b/library/Class/WebService/SIGB/Opsys/ServiceFactory.php index 1789417de90b438a6e3639147c72a76367dc1ae7..f91639d5f405555f1ddde4f47fc46eace3470178 100644 --- a/library/Class/WebService/SIGB/Opsys/ServiceFactory.php +++ b/library/Class/WebService/SIGB/Opsys/ServiceFactory.php @@ -22,7 +22,6 @@ include_once('Service.php'); class Class_WebService_SIGB_Opsys_ServiceFactory{ - const ALOES_ROOT = "http://81.80.216.130/websrvaloes"; const SERVICE_SEARCH = "servicerecherche.asmx?WSDL"; const SERVICE_CATALOG = "catalogueWeb.asmx?WSDL"; const MOCK_WSDL = "http://localhost:8088/mockServiceRechercheSoap?WSDL"; @@ -50,15 +49,19 @@ class Class_WebService_SIGB_Opsys_ServiceFactory{ } public function getAloesRootFromUrl($url) { - return array_first(explode('websrvaloes', $url)).'websrvaloes'; + $url = preg_replace('|websrvaloes|i', 'websrvaloes', $url); + $root = array_first(explode('websrvaloes', $url)); + if ('/' != substr($root, -1)) + $root .= '/'; + return $root . 'websrvaloes/'; } public function getWsdlSearchURL($url_aloes) { - return $this->getAloesRootFromUrl($url_aloes).'/'.self::SERVICE_SEARCH; + return $this->getAloesRootFromUrl($url_aloes) . self::SERVICE_SEARCH; } public function getWsdlCatalogURL($url_aloes) { - return $this->getAloesRootFromUrl($url_aloes).'/'.self::SERVICE_CATALOG; + return $this->getAloesRootFromUrl($url_aloes) . self::SERVICE_CATALOG; } public function createOpsysService($url_aloes, diff --git a/library/ZendAfi/Controller/Plugin/InspectorGadget.php b/library/ZendAfi/Controller/Plugin/InspectorGadget.php index a2b87bfbd3209df70b0c454719069a7684f87f11..f37724b75be9e5d8b6e37ae53b79e0e7cc38a93d 100644 --- a/library/ZendAfi/Controller/Plugin/InspectorGadget.php +++ b/library/ZendAfi/Controller/Plugin/InspectorGadget.php @@ -213,7 +213,7 @@ create: function(event, ui) { if (ui.panel.hasClass(\'ig-accordion\')) ui.panel. public function logSoap($client) { - $call = new ZendAfi_Controller_Plugin_InspectorGadget_SoapCall + $call = new ZendAfi_Controller_Plugin_InspectorGadget_ServiceCall ($client->__getLastRequestHeaders(), $client->__getLastRequest(), $client->__getLastResponseHeaders(), diff --git a/tests/library/Class/WebService/SIGB/OpsysServiceTest.php b/tests/library/Class/WebService/SIGB/OpsysServiceTest.php index 8264382240cc4a9653628a0a4ea5329db1e21df4..874aea44d7e3e109e35625493541c1c5cfb38cb3 100644 --- a/tests/library/Class/WebService/SIGB/OpsysServiceTest.php +++ b/tests/library/Class/WebService/SIGB/OpsysServiceTest.php @@ -47,7 +47,7 @@ class StubSoapClient { -abstract class OpsysServiceFactoryWithCatalogueWebTestCase extends Storm_Test_ModelTestCase { +abstract class OpsysServiceFactoryWithCatalogueWebTestCase extends ModelTestCase { protected $_service; public function setUp() { @@ -127,7 +127,7 @@ class OpsysServiceFactoryWithoutParamCatalogueWebTest extends OpsysServiceFactor -class OpsysServiceTestAutoConnect extends Storm_Test_ModelTestCase { +class OpsysServiceTestAutoConnect extends ModelTestCase { private $ouvre_session_res; private $client; @@ -182,7 +182,7 @@ class OpsysServiceTestAutoConnect extends Storm_Test_ModelTestCase { } -class Class_System_OpsysServiceFactoryTestUrls extends Storm_Test_ModelTestCase { +class Class_System_OpsysServiceFactoryTestUrls extends ModelTestCase { public function setUp() { $this->factory = new Class_WebService_SIGB_Opsys_ServiceFactory(); } @@ -202,11 +202,21 @@ class Class_System_OpsysServiceFactoryTestUrls extends Storm_Test_ModelTestCase $this->assertEquals('http://10.0.0.1/websrvaloes/catalogueWeb.asmx?WSDL', $this->factory->getWsdlCatalogURL($root_url)); } + + + /** @test */ + public function uppercaseShouldWork() { + $root_url = 'http://10.0.0.1/WebSrvAloes/ServiceRecherche.asmx?WSDL'; + $this->assertEquals('http://10.0.0.1/websrvaloes/servicerecherche.asmx?WSDL', + $this->factory->getWsdlSearchURL($root_url)); + $this->assertEquals('http://10.0.0.1/websrvaloes/catalogueWeb.asmx?WSDL', + $this->factory->getWsdlCatalogURL($root_url)); + } } -class Class_WebService_SIGB_OpsysServiceTestProxy extends Storm_Test_ModelTestCase { +class Class_WebService_SIGB_OpsysServiceTestProxy extends ModelTestCase { private $factory; private $mock_opsys_service; @@ -282,7 +292,7 @@ class Class_WebService_SIGB_OpsysServiceTestProxy extends Storm_Test_ModelTestCa } -class OpsysServiceNoticeTestDispoExemplaire extends Storm_Test_ModelTestCase { +class OpsysServiceNoticeTestDispoExemplaire extends ModelTestCase { public function testPopDisponibiliteOnEmptyNoticeReturnsFalse(){ $notice = new Class_WebService_SIGB_Notice('123'); $this->assertFalse($notice->popDisponibilite()); @@ -304,7 +314,7 @@ class OpsysServiceNoticeTestDispoExemplaire extends Storm_Test_ModelTestCase { -class OpsysServiceNoticeCacheTestGetExemplaire extends Storm_Test_ModelTestCase { +class OpsysServiceNoticeCacheTestGetExemplaire extends ModelTestCase { private $notices; private $cache; @@ -412,7 +422,7 @@ class OpsysServiceNoticeCacheTestGetExemplaire extends Storm_Test_ModelTestCase -abstract class OpsysServiceWithSessionTestCase extends Storm_Test_ModelTestCase { +abstract class OpsysServiceWithSessionTestCase extends ModelTestCase { protected $opsys; public function setUp(){ @@ -992,7 +1002,9 @@ class OpsysServiceTestProlongerPret extends OpsysServiceWithSessionTestCase { } } -abstract class OpsysServiceNoticeAbstractTest extends Storm_Test_ModelTestCase { + + +abstract class OpsysServiceNoticeAbstractTest extends ModelTestCase { protected $response; public function setUp() { $emplacement_reserve = Class_CodifEmplacement::newInstanceWithId(3) @@ -1175,7 +1187,7 @@ class OpsysServicePiegesTest extends OpsysServiceNoticeAbstractTest{ -class OpsysServiceEmprReserverResponseTest extends Storm_Test_ModelTestCase { +class OpsysServiceEmprReserverResponseTest extends ModelTestCase { private $default_rsp; public function setUp(){ @@ -1201,7 +1213,8 @@ class OpsysServiceEmprReserverResponseTest extends Storm_Test_ModelTestCase { } -class OpsysServiceEmprunteurAttributesTest extends Storm_Test_ModelTestCase { + +class OpsysServiceEmprunteurAttributesTest extends ModelTestCase { public function setUp(){ $this->opsys_service = $this->createMock('Mock_OpsysService', array('getEmpruntsOf', @@ -1277,8 +1290,7 @@ class OpsysServiceEmprunteurAttributesTest extends Storm_Test_ModelTestCase { - -class OpsysServiceReservationEmittedTest extends Storm_Test_ModelTestCase { +class OpsysServiceReservationEmittedTest extends ModelTestCase { public function setUp(){ $this->reservation = new Class_WebService_SIGB_Reservation('23', new Class_WebService_SIGB_Exemplaire('potter')); $this->reservation->parseExtraAttributes([ @@ -1308,7 +1320,7 @@ class OpsysServiceReservationEmittedTest extends Storm_Test_ModelTestCase { -class OpsysServiceReservationAvailableTest extends Storm_Test_ModelTestCase { +class OpsysServiceReservationAvailableTest extends ModelTestCase { public function setUp(){ $this->reservation = new Class_WebService_SIGB_Opsys_Reservation('23', new Class_WebService_SIGB_Exemplaire('potter')); @@ -1372,7 +1384,7 @@ class EmpruntFixtures { -class OpsysServiceEmpruntAttributesTest extends Storm_Test_ModelTestCase { +class OpsysServiceEmpruntAttributesTest extends ModelTestCase { public function setUp() { $this->emprunt = EmpruntFixtures::potter(); } @@ -1408,7 +1420,7 @@ class OpsysServiceEmpruntAttributesTest extends Storm_Test_ModelTestCase { -class OpsysServiceEmpruntRetardAttributesTest extends Storm_Test_ModelTestCase { +class OpsysServiceEmpruntRetardAttributesTest extends ModelTestCase { public function setUp() { $this->emprunt = EmpruntFixtures::potter(); $this->emprunt->setEnRetard(true); @@ -1441,7 +1453,7 @@ class OpsysServiceEmpruntRetardAttributesTest extends Storm_Test_ModelTestCase { -class OpsysServiceEmpruntTestSort extends Storm_Test_ModelTestCase { +class OpsysServiceEmpruntTestSort extends ModelTestCase { public function setUp() { $this->opsys_service = $this->createMock('Mock_OpsysService', ['getEmpruntsOf', @@ -1485,7 +1497,7 @@ class OpsysServiceEmpruntTestSort extends Storm_Test_ModelTestCase { -class OpsysServiceEmprunteurTestPretsEnRetard extends Storm_Test_ModelTestCase { +class OpsysServiceEmprunteurTestPretsEnRetard extends ModelTestCase { /** @var Class_WebService_SIGB_Emprunteur */ protected $emprunteur; @@ -1580,7 +1592,7 @@ class OpsysServiceTestReserverExemplaireWithOptionReserverRetraitBibAbonne exten -class OpsysServiceTestEntiteEmprWithPret extends Storm_Test_ModelTestCase { +class OpsysServiceTestEntiteEmprWithPret extends ModelTestCase { public function setUp() { parent::setUp();