Skip to content
Snippets Groups Projects
Commit bcb92bdf authored by llaffont's avatar llaffont
Browse files

Correction récupération résumés éditeurs suite à maj site tiers

parent b007c077
Branches
Tags
No related merge requests found
......@@ -62,6 +62,9 @@ class Class_WebService_Fnac extends Class_WebService_Abstract {
public function extractResumeFromHTML($html) {
if ($pos = striPos($html, "avisEdContent"))
return $this->extractLireLaSuiteDivAvisEditeurFromHTML($html);
if (!$pos = striPos($html, "laSuite bigLaSuite"))
return $this->extractLireLaSuiteDivFromHTML($html);
......@@ -77,6 +80,14 @@ class Class_WebService_Fnac extends Class_WebService_Abstract {
}
public function extractLireLaSuiteDivAvisEditeurFromHTML($html) {
$pos = strPos($html, "avisEdContent") + 15;
$posfin = strPos($html, "</div>", $pos);
$resume = substr($html, $pos, ($posfin-$pos));
return trim($resume);
}
public function extractLireLaSuiteDivFromHTML($html) {
$start_string = "lireLaSuite mrg_v_sm";
if (!$pos = striPos($html, $start_string))
......
......@@ -52,7 +52,7 @@ class SystemeControllerWebServicesActionTest extends Admin_AbstractControllerTes
public function webServiceFnacGetResumeShouldWork() {
$this->dispatch('/admin/systeme/webservices/id_service/Fnac/id_fonction/1');
$this->assertXPathContentContains('//pre[@class="resultat"]',
'Lisbeth et Mickael',
'Tandis que Lisbeth Salander',
$this->_response->getBody());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment