Skip to content
Snippets Groups Projects
Commit 5b1aaea5 authored by Matthias Meusburger's avatar Matthias Meusburger
Browse files

rel #27974 : fix RT

parent 26f5d953
Branches
Tags
2 merge requests!1178Dev#27974 enlarge your search,!1160Dev#27974 enlarge your search
......@@ -24,6 +24,12 @@ abstract class RechercheControllerSearchExtensionTestCase extends AbstractContro
public function setUp() {
parent::setUp();
Zend_Registry::set('sql',
$this->mock()
->whenCalled('fetchAll')
->answers([]));
$this->_prepareFixtures();
$this->dispatch('/opac/recherche/simple?expressionRecherche=sport', true);
}
......@@ -50,7 +56,7 @@ class RechercheControllerSearchExtensionDisabledTest
/** @test */
public function shouldNotContainsExtensionLinks() {
$this->assertNotXPathContentContains('//*', 'Rechercher aussi sur');
$this->assertNotXPathContentContains('//div', 'Rechercher aussi sur');
}
}
......@@ -61,7 +67,7 @@ class RechercheControllerSearchExtensionEnabledWithEmptySiteAndUrlTest
/** @test */
public function shouldNotContainsExtensionLinks() {
$this->assertNotXPathContentContains('//*', 'Rechercher aussi sur');
$this->assertNotXPathContentContains('//div', 'Rechercher aussi sur');
}
}
......@@ -77,7 +83,7 @@ class RechercheControllerSearchExtensionEnabledWithSiteAndNoUrlTest
/** @test */
public function shouldNotContainsExtensionLinks() {
$this->assertNotXPathContentContains('//*', 'Rechercher aussi sur');
$this->assertNotXPathContentContains('//div', 'Rechercher aussi sur');
}
}
......@@ -93,7 +99,7 @@ class RechercheControllerSearchExtensionEnabledWithUrlAndNoSiteTest
/** @test */
public function shouldNotContainsExtensionLinks() {
$this->assertNotXPathContentContains('//*', 'Rechercher aussi sur');
$this->assertNotXPathContentContains('//div', 'Rechercher aussi sur');
}
}
......@@ -104,33 +110,37 @@ class RechercheControllerSearchExtensionEnabledTest
protected function _extensionSites() {
return ['site_label' => ['Jumel',
'Incomplete'],
'Incomplete',
'Trouvons.org',],
'site_url' => ['http://www.jumel39.fr/rechercher?search_api_views_fulltext=%s',
'']];
'',
'http://trouvons.org/#q=%s']];
}
/** @test */
public function shouldContainsExtensionLinks() {
$this->assertXPathContentContains('//*', 'Rechercher aussi sur');
$this->assertXPathContentContains('//div', 'Rechercher aussi sur');
}
/** @test */
public function shouldContainsLink() {
$this->assertXPathContentContains('//a', 'Jumel');
public function shouldContainsJumelLink() {
$this->assertXPathContentContains('//a[contains(@href, "rechercher?search_api_views_fulltext=sport")]',
'Jumel');
}
/** @test */
public function hrefShouldContainsSport() {
$this->assertXPath('//a[contains(@href, "rechercher?search_api_views_fulltext=sport")]');
public function shouldNotDisplayIncompletLink() {
$this->assertNotXPathContentContains('//a', 'Incomplete');
}
/** @test */
public function shouldNotDisplayIncompletLink() {
$this->assertNotXPathContentContains('//a', 'Incomplete');
public function shouldContainsTrouvonsLink() {
$this->assertXPathContentContains('//a[contains(@href, "#q=sport")]',
'Trouvons.org');
}
}
......@@ -142,6 +152,11 @@ class RechercheControllerSearchExtensionWithoutTermsTest extends AbstractControl
public function setUp() {
parent::setUp();
Zend_Registry::set('sql',
$this->mock()
->whenCalled('fetchAll')
->answers([]));
$this->fixture('Class_AdminVar',
['id' => 'SEARCH_ALSO_IN',
'valeur' => json_encode(['site_label' => ['Jumel'],
......@@ -153,6 +168,6 @@ class RechercheControllerSearchExtensionWithoutTermsTest extends AbstractControl
/** @test */
public function shouldNotContainsExtensionLinks() {
$this->assertNotXPathContentContains('//*', 'Rechercher aussi sur');
$this->assertNotXPathContentContains('//div', 'Rechercher aussi sur');
}
}
\ 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