Skip to content
Snippets Groups Projects
Commit 90d1bb93 authored by Laurent's avatar Laurent
Browse files

dev #22209 search result feed

better feed tite
parent b7c98ee3
Branches
Tags
3 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1027Dev#22209 search result feed,!1026Dev#22209 search result feed
......@@ -98,21 +98,19 @@ class ZendAfi_Feed_SearchResultHeader {
public function visitSearchResult($search_result) {
$this->_description = $this->_plural($search_result->getRecordsCount(),
"Aucun résultat trouvé",
"Il y a %d résultat",
"Il y a %d résultats",
$search_result->getRecordsCount());
$this->_header->description = $this->_plural($search_result->getRecordsCount(),
"Aucun résultat trouvé",
"Il y a %d résultat",
"Il y a %d résultats",
$search_result->getRecordsCount());
$search_result->acceptCriteresVisitor($this);
$this->_header->description = $this->_description
. '. '
. implode('. ', $this->_criterias);
$this->_header->title = $this->_('Recherche: ').implode('. ', $this->_criterias);
}
public function setErreur($error) {
$this->addCriteria($this->_('Erreur'), $error);
$this->_header->description .= $this->_('Erreur') . ': ' . $error;
}
......@@ -122,8 +120,7 @@ class ZendAfi_Feed_SearchResultHeader {
public function visitExpression($expression) {
$this->_description .= ' ' . $this->_('pour: ') . $expression;
$this->_header->title = $this->_('Recherche') . ': ' . $expression;
$this->addCriteria($this->_('Expression'), $expression);
}
......@@ -142,12 +139,12 @@ class ZendAfi_Feed_SearchResultHeader {
public function visitCatalogue($catalogue) {
$this->_description .= ' ' . $this->_('pour le catalogue: ') . $catalogue->getLibelle();
$this->addCriteria($this->_('Domaine'), $catalogue->getLibelle());
}
public function visitPanier($panier) {
$this->_description .= ' ' . $this->_('pour le panier: ') . $panier->getLibelle();
$this->addCriteria($this->_('Panier'), $panier->getLibelle());
}
......
......@@ -179,7 +179,7 @@ class RechercheControllerAtomWithTwoNoticesTest extends RechercheControllerAtomW
public function feedTitleShouldBeRechercheHarryPotter() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:title',
'Recherche: Harry Potter');
'Recherche: Expression: Harry Potter');
}
......@@ -200,17 +200,17 @@ class RechercheControllerAtomWithTwoNoticesTest extends RechercheControllerAtomW
/** @test */
public function feedSummaryShouldContainsTwoResults() {
public function feedSubtitleShouldContainsTwoResults() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
"Il y a 2 résultats pour: Harry Potter");
"Il y a 2 résultats");
}
/** @test */
public function feedSummaryShouldContainsCriteres() {
public function feedTitleShouldContainsCriteres() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
"Section: Adulte. Genre: Science-Fiction");
}
......@@ -248,7 +248,7 @@ class RechercheControllerAtomWithTwoNoticesTest extends RechercheControllerAtomW
/** @test */
public function firstEntryContentShouldContainsSummary() {
public function firstEntryContentShouldContainsSubtitle() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:entry/atom:content',
'Harry Potter il va tout dégommer');
......@@ -287,9 +287,9 @@ class RechercheControllerAtomWithTwoNoticesTest extends RechercheControllerAtomW
/** @test */
public function entrySummaryShouldNotBePresent() {
public function entrySubtitleShouldNotBePresent() {
$this->_xpath->assertNotXPath($this->_response->getBody(),
'//atom:entry/atom:summary');
'//atom:entry/atom:subtitle');
}
}
......@@ -307,7 +307,7 @@ class RechercheControllerAtomWithErrorTest extends RechercheControllerAtomWithTw
/** @test */
public function feedSummaryShouldContainsSelectionWithoutNotices() {
public function feedSubtitleShouldContainsSelectionWithoutNotices() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'La sélection ne contient aucune notice');
......@@ -343,10 +343,10 @@ class RechercheControllerAtomOnDomainTest extends RechercheControllerAtomWithTwo
/** @test */
public function feedSummaryShouldContainsCatalogue() {
public function feedTitleShouldContainsDomaine() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
"Il y a 2 résultats pour le catalogue: mangas");
'//atom:feed/atom:title',
"Domaine: mangas");
}
}
......@@ -369,26 +369,26 @@ class RechercheControllerAtomOnPanierTypeDocNouveauteTest extends RechercheContr
/** @test */
public function feedSummaryShouldContainsPanierMangas() {
public function feedTitleShouldContainsPanierMangas() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
"Il y a 2 résultats pour le panier: mangas");
'//atom:feed/atom:title',
"Panier: mangas");
}
/** @test */
public function feedSummaryShouldContainsTypeDoc() {
public function feedTitleShouldContainsTypeDoc() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
"Type de document: livre");
}
/** @test */
public function feedSummaryShouldContainsNouveaute() {
public function feedTitleShouldContainsNouveaute() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
"Nouveautés de moins de: 3 mois");
}
}
......@@ -401,9 +401,9 @@ class RechercheControllerAtomWithSerieTest extends RechercheControllerAtomWithTw
}
/** @test */
public function feedSummaryShouldContainsSerie() {
public function feedTitleShouldContainsSerie() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
'Série: Harry Potter');
}
}
......@@ -427,9 +427,9 @@ class RechercheControllerAtomWithRubricTest extends RechercheControllerAtomWithT
}
/** @test */
public function feedSummaryShouldContainsRubriqueMangas() {
public function feedTitleShouldContainsRubriqueMangas() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
'Rubrique: mangas');
}
}
......@@ -442,9 +442,9 @@ class RechercheControllerAtomWithCodeRebondTest extends RechercheControllerAtomW
}
/** @test */
public function feedSummaryShouldContainsRechercheElargie() {
public function feedTitleShouldContainsRechercheElargie() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
'Recherche élargie à: Science-Fiction');
}
}
......@@ -458,18 +458,27 @@ class RechercheControllerAtomWithAdvancedSearchTest extends RechercheControllerA
/** @test */
public function feedSummaryShouldContainsRechercheTitresOrAuteur() {
public function feedTitleShouldContainsRechercheTitresOrAuteur() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
'Et titre: potter. Ou auteur: rowling');
}
/** @test */
public function feedSummaryShouldContainsAnnexeAnnecy() {
public function feedTitleShouldContainsAnnexeAnnecy() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:subtitle',
'//atom:feed/atom:title',
'Annexe: Annecy');
}
/** @test */
public function feedTitleShouldBeRendezVous() {
$this->_xpath->assertXPathContentContains($this->_response->getBody(),
'//atom:feed/atom:title',
'Recherche: Et titre: potter');
}
}
?>
\ No newline at end of file
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