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