Skip to content
Snippets Groups Projects
Commit d59638c1 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #64573 fix failures

parent fc62f020
Branches
Tags
3 merge requests!3297WIP: Master,!3037Master,!2988Dev#64573 templates pour l interface publique libraire bootstrap
Pipeline #6472 passed with stage
in 32 minutes and 56 seconds
......@@ -90,7 +90,7 @@ class Bookmarks_LibrariesItemsTableWithLibrariesTest extends ViewHelperTestCase
'localisation' => 1,
'plan' => 1,
'resa' => 1]])
->assertSave();
->assertSave();
$this->html = $this->_helper->Notice_Exemplaires($items);
}
......@@ -123,8 +123,7 @@ class Bookmarks_LibrariesItemsTableWithLibrariesTest extends ViewHelperTestCase
abstract class Bookmarks_LibrariesItemsTableWithAnnexTestCase extends ViewHelperTestCase {
protected $_storm_default_to_volatile = true;
abstract class Bookmarks_LibrariesItemsTableWithAnnexTestCase extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
......@@ -147,10 +146,6 @@ abstract class Bookmarks_LibrariesItemsTableWithAnnexTestCase extends ViewHelper
789])
->assertSave();
$this->_helper = new ZendAfi_View_Helper_Notice_Exemplaires();
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->fixture('Class_CodifSection',
['id' => 2,
'libelle' => 'Adulte']);
......@@ -216,6 +211,10 @@ abstract class Bookmarks_LibrariesItemsTableWithAnnexTestCase extends ViewHelper
protected function buildItems() {
$this->fixture('Class_Notice',
['id' => 24765,
'clef_oeuvre' => 'TROLLS']);
$first_item = $this->fixture('Class_Exemplaire',
['id' => 12,
'id_bib' => 654321,
......@@ -272,38 +271,38 @@ class Bookmarks_LibrariesItemsTableWithAnnexTest extends Bookmarks_LibrariesItem
public function setUp() {
parent::setUp();
$this->html = $this->_helper->Notice_Exemplaires($this->buildItems());
$this->buildItems();
$this->dispatch('/noticeajax/exemplaires/id/24765');
}
/** @test */
public function pageShouldContainsTwoItemsTable() {
$this->assertXPathCount($this->html, '//div/table', 2);
$this->assertXPathCount('//div/table', 2, $this->_response->getBody());
}
/** @test */
public function pageShouldContainsTwoNoticeBlocTitre() {
$this->assertXPathCount($this->html, '//div/h3[@class="notice_bloc_titre"]', 2);
$this->assertXPathCount('//div/h3[@class="notice_bloc_titre"]', 2);
}
/** @test */
public function linkToUnbookmarkLibraryAdmoShouldBePresent() {
$this->assertXPathContentContains($this->html, '//table[1]//td/a[contains(@href, "/abonne/remove-library-from-bookmarks/library_id/654321")][@class="remove_from_bookmarks"]', 'Supprimer de mes favoris');
$this->assertXPathContentContains('//table[1]//td/a[contains(@href, "/abonne/remove-library-from-bookmarks/library_id/654321")][@class="remove_from_bookmarks"]', 'Supprimer de mes favoris');
}
/** @test */
public function linkToUnbookmarkLibraryRikiShouldBePresent() {
$this->assertXPathContentContains($this->html, '//table[1]//td/a[contains(@href, "/abonne/remove-library-from-bookmarks/library_id/789")][@class="remove_from_bookmarks"]', 'Supprimer de mes favoris');
$this->assertXPathContentContains('//table[1]//td/a[contains(@href, "/abonne/remove-library-from-bookmarks/library_id/789")][@class="remove_from_bookmarks"]', 'Supprimer de mes favoris');
}
/** @test */
public function linkTobookmarkLibraryBiloShouldBePresent() {
$this->assertXPathContentContains($this->html, '//table//td/a[contains(@href, "/abonne/add-library-to-bookmarks/library_id/12389")][@class="add_to_bookmarks"]', 'Ajouter ');
$this->assertXPathContentContains('//table//td/a[contains(@href, "/abonne/add-library-to-bookmarks/library_id/12389")][@class="add_to_bookmarks"]', 'Ajouter ');
}
}
......@@ -317,19 +316,20 @@ class Bookmarks_LibrariesItemsTableWithAnnexAndProfilFilterTest extends Bookmark
->setSelAnnexe('Riki')
->assertSave();
$this->html = $this->_helper->Notice_Exemplaires($this->buildItems());
$this->buildItems();
$this->dispatch('/noticeajax/exemplaires/id/24765');
}
/** @test */
public function pageShouldContainsOneItemTable() {
$this->assertXPathCount($this->html, '//table', 1, $this->html);
$this->assertXPathCount('//table', 1, $this->html);
}
/** @test */
public function itemCoteColumnShouldContainsCOTE2() {
$this->assertXPathContentContains($this->html, '//tr/td', 'COTE2');
$this->assertXPathContentContains('//tr/td', 'COTE2');
}
}
......@@ -343,19 +343,20 @@ class Bookmarks_LibrariesItemsTableWithLibraryAndProfilFilterTest extends Bookma
->setIdSite(654321)
->assertSave();
$this->html = $this->_helper->Notice_Exemplaires($this->buildItems());
$this->buildItems();
$this->dispatch('/noticeajax/exemplaires/id/24765');
}
/** @test */
public function pageShouldContainsOneItemTable() {
$this->assertXPathCount($this->html, '//table', 1, $this->html);
$this->assertXPathCount('//table', 1, $this->html);
}
/** @test */
public function itemCoteColumnShouldContainsDSEM() {
$this->assertXPathContentContains($this->html, '//tr/td', 'DSEM');
$this->assertXPathContentContains('//tr/td', 'DSEM');
}
}
......@@ -369,19 +370,20 @@ class Bookmarks_LibrariesItemsTableWithSectionAndProfilFilterTest extends Bookma
->setSelSection('2')
->assertSave();
$this->html = $this->_helper->Notice_Exemplaires($this->buildItems());
$this->buildItems();
$this->dispatch('/noticeajax/exemplaires/id/24765');
}
/** @test */
public function pageShouldContainsOneItemTable() {
$this->assertXPathCount($this->html, '//table', 1, $this->html);
$this->assertXPathCount('//table', 1, $this->html);
}
/** @test */
public function itemAnnexColumnShouldContainsBilo() {
$this->assertXPathContentContains($this->html, '//tr/td', 'Bilo Library');
$this->assertXPathContentContains('//tr/td', 'Bilo Library');
}
}
......@@ -392,31 +394,33 @@ class Bookmarks_LibrariesItemsTableWithBookmarkedLibrariesInItemsSettingsTest ex
public function setUp() {
parent::setUp();
ZendAfi_Auth::getInstance()->clearIdentity();
$this->html = $this->_helper->Notice_Exemplaires($this->buildItems());
$this->buildItems();
$this->dispatch('/noticeajax/exemplaires/id/24765');
}
/** @test */
public function pageShouldContainsTwoItemsTable() {
$this->assertXPathCount($this->html, '//table', 2, $this->html);
$this->assertXPathCount('//table', 2, $this->html);
}
/** @test */
public function firstTableitemAnnexColumnShouldContainsAdmo() {
$this->assertXPathContentContains($this->html, '//body/table//tr/td', 'Admo Library');
$this->assertXPathContentContains('//body/table//tr/td', 'Admo Library');
}
/** @test */
public function firstTableitemAnnexColumnShouldContainsRiki() {
$this->assertXPathContentContains($this->html, '//body/table//tr/td', 'Riki Library');
$this->assertXPathContentContains('//body/table//tr/td', 'Riki Library');
}
/** @test */
public function secondTableitemAnnexColumnShouldContainsBilo() {
$this->assertXPathContentContains($this->html, '//body/div[1]//table//tr/td', 'Bilo Library');
$this->assertXPathContentContains('//body/div[1]//table//tr/td', 'Bilo Library');
}
}
......
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