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

dev #81899 more tests

parent b5098440
Branches
Tags
3 merge requests!3297WIP: Master,!2924Dev#81899 pairing fiche auteur,!2923Dev#81899 pairing fiche auteur
Pipeline #5552 failed with stage
in 26 minutes and 27 seconds
......@@ -78,18 +78,21 @@ $this->openBoite($this->titre);
<div class="records">
<?php
foreach($this->records_by_doctype as $doc_type_id => $records) {
$type_doc_label = Class_TypeDoc::find($doc_type_id)->getLibelle();
$type_doc = Class_TypeDoc::find($doc_type_id);
echo $this->tag('div',
implode('',
[$this->tag('h2',
$this->tagAnchor(Class_Url::assemble(['controller' => 'recherche',
'action' => 'simple',
'code_rebond' => 'A' . $this->author->getId(),
'facette' => 'T' . $doc_type_id]),
$type_doc_label,
['title' => $this->_('Afficher tous les "%s"',
$type_doc_label)] )),
$this->listeNotices_SimpleWall($records)
'code_rebond' => $this->author->getFacetCode(),
'facette' => $type_doc->getFacetCode()]),
$type_doc->getLibelle(),
['title' => $this->_('Afficher tous les documents de type "%s" pour "%s"',
$type_doc->getLibelle(),
$this->author->getLibelle())] )),
str_replace('/recherche/viewnotice/id/',
'/recherche/viewnotice/code_rebond/' . $this->author->getFacetCode() . '/facette/' . $type_doc->getFacetCode() . '/id/',
$this->listeNotices_SimpleWall($records))
.
$this->tag('div',
$this->tag('a',
......
......@@ -32,7 +32,7 @@ class AuthorPageTest extends AbstractControllerTestCase {
'type_doc' => Class_TypeDoc::LIVRE,
'clef_alpha'=>'GAVROCHE_HUGO',
'titre_principal' => 'Gavroche',
'facettes' => 'A2408 A3',
'facettes' => 'A2408 A3 G4 M6',
'url_vignette' => 'gavroche.jpg']);
$this->fixture('Class_Notice',
......@@ -40,7 +40,7 @@ class AuthorPageTest extends AbstractControllerTestCase {
'type_doc' => Class_TypeDoc::LIVRE,
'clef_alpha'=>'MISERABLES_HUGO',
'titre_principal' => 'Les Misérables',
'facettes' => 'A2408',
'facettes' => 'A2408 M6',
'url_vignette' => 'miserables.jpg']);
$this->fixture('Class_Notice',
......@@ -52,14 +52,21 @@ class AuthorPageTest extends AbstractControllerTestCase {
'url_vignette' => 'paris.jpg']);
$this->fixture('Class_CodifAuteur',
['id' => '2408',
['id' => 2408,
'libelle' => 'Victor Hugo']);
$this->fixture('Class_CodifAuteur',
['id' => '3',
['id' => 3,
'libelle' => 'Robert Hossein']);
$this->fixture('Class_CodifGenre',
['id' => 4,
'libelle' => 'Romans']);
$this->fixture('Class_CodifMatiere',
['id' => 6,
'libelle' => '19e siècle']);
$this->mock_sql = $this->mock()
->whenCalled('fetchAll')
......@@ -150,4 +157,43 @@ class AuthorPageTest extends AbstractControllerTestCase {
public function pageShouldBeAccessible() {
$this->assertAccessible();
}
/** @test */
public function pageShouldContainsAssociatedTermsRomans() {
$this->assertXPathContentContains('//div[@class="facets"]//a[contains(@href, "/recherche/simple/code_rebond/A2408/facette/G4")]',
'Romans');
}
/** @test */
public function pageShouldContainsAssociatedTerms19eSiecle() {
$this->assertXPathContentContains('//div[@class="facets"]//a[contains(@href, "/recherche/simple/code_rebond/A2408/facette/M6")]',
'19e siècle');
}
/** @test */
public function associatedTermRomansShouldBeOnSecondPosition() {
$this->assertXPathContentContains('//div[@class="facets"]/div/a[2]', 'Romans');
}
/** @test */
public function pageShouldContainsFiveSeeMoreLinks() {
$this->assertXPathCount('//div[@class="see_more"]/a', 5);
}
/** @test */
public function pageShouldContainsLinkH2ToSearchAllBooks() {
$this->assertXPathContentContains('//div[@class="records"]//h2/a[contains(@href, "/recherche/simple/code_rebond/A2408/facette/T1")][@title=\'Afficher tous les documents de type "livres" pour "Victor Hugo"\']',
'livres');
}
/** @test */
public function pageShouldLinkTwoBooks() {
$this->assertXPathCount('//div[@class="records"]//div[@class="simple_wall"]/a[contains(@href, "/recherche/viewnotice/code_rebond/A2408/facette/T1/id/")]', 2);
}
}
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