From 8baf4a17dda156dbf36d30012c50850c0f285b45 Mon Sep 17 00:00:00 2001 From: llaffont <llaffont@afi-sa.fr> Date: Sat, 25 Jul 2015 16:12:01 +0200 Subject: [PATCH] dev #22209 search result feed reification of Search Result - test fix --- .../View/Helper/Notice/NavigationTest.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/library/ZendAfi/View/Helper/Notice/NavigationTest.php b/tests/library/ZendAfi/View/Helper/Notice/NavigationTest.php index 90719fbc730..032a3d0dada 100644 --- a/tests/library/ZendAfi/View/Helper/Notice/NavigationTest.php +++ b/tests/library/ZendAfi/View/Helper/Notice/NavigationTest.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE * along with BOKEH; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ abstract class ZendAfi_View_Helper_Notice_NavigationTestCase extends ViewHelperTestCase { @@ -28,14 +28,17 @@ abstract class ZendAfi_View_Helper_Notice_NavigationTestCase extends ViewHelperT $this->_helper = new ZendAfi_View_Helper_Notice_Navigation(); $this->_helper->setView(new ZendAfi_Controller_Action_Helper_View()); - + Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Notice') ->whenCalled('getNoticeIdsByRequeteRecherche') ->answers([10,99,88,1,2,34,4]); - - $mock_moteur = Storm_Test_ObjectWrapper::mock() + + $mock_moteur = Storm_Test_ObjectWrapper::mock(); + $mock_moteur ->whenCalled('lancerRecherche') - ->answers(['req_liste' => 'select * from notices']); + ->answers((new Class_MoteurRecherche_Result($mock_moteur, + new Class_CriteresRecherche())) + ->setRecordsQuery('select * from notices')); $this->notice_navigation = new Class_Notice_NavigationRecherche(new Class_CriteresRecherche(), $mock_moteur, @@ -68,7 +71,7 @@ class ZendAfi_View_Helper_Notice_Navigation_MiddleTest extends ZendAfi_View_Help /** @test */ public function nombreTotalShouldContains4slash7() { $this->assertXPathcontentContains($this->_html,'//div//span','4 sur 7'); - } + } } @@ -87,7 +90,7 @@ class ZendAfi_View_Helper_Notice_Navigation_BeginTest extends ZendAfi_View_Helpe /** @test */ public function resultatPrecedentShouldNotBeVisible() { $this->assertNotXPath($this->_html, - '//div//a[@id="previousrecord"]', + '//div//a[@id="previousrecord"]', $this->_html); } @@ -113,7 +116,7 @@ class ZendAfi_View_Helper_Notice_Navigation_EndTest extends ZendAfi_View_Helper_ /** @test */ public function resultatPrecedentShouldLinkToNavigationPrecedent() { $this->assertXPath($this->_html, - '//div//a[contains(@href, "navigation/precedent")][@id="previousrecord"][@title="Document précédent"]', + '//div//a[contains(@href, "navigation/precedent")][@id="previousrecord"][@title="Document précédent"]', $this->_html); } @@ -122,7 +125,7 @@ class ZendAfi_View_Helper_Notice_Navigation_EndTest extends ZendAfi_View_Helper_ $this->assertXPathcontentContains($this->_html,'//div//span','7 sur 7'); } - + } ?> -- GitLab