From 2a708d9afa6b044c3d89f3aa5784fca480f6e9b8 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Tue, 31 Aug 2010 05:52:48 +0000 Subject: [PATCH] BUGFIX: fix TranslatableSearchFormText by supporting fulltext search for MSSQL and using extendedSQL function call that augments queries properly (previously it was using DB::query which does not augment). Added wait to TranslatableSearchFormText so the test actually passes. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110262 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- tests/search/TranslatableSearchFormTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/search/TranslatableSearchFormTest.php b/tests/search/TranslatableSearchFormTest.php index 8cc299f7c..decc13eed 100644 --- a/tests/search/TranslatableSearchFormTest.php +++ b/tests/search/TranslatableSearchFormTest.php @@ -21,6 +21,11 @@ class TranslatableSearchFormTest extends FunctionalTest { "ContentControllerSearchExtension", ), ); + + function waitUntilIndexingFinished() { + $db = DB::getConn(); + if (method_exists($db, 'waitUntilIndexingFinished')) DB::getConn()->waitUntilIndexingFinished(); + } function setUpOnce() { // HACK Postgres doesn't refresh TSearch indexes when the schema changes after CREATE TABLE @@ -40,6 +45,8 @@ class TranslatableSearchFormTest extends FunctionalTest { // whenever a translation is created, canTranslate() is checked $admin = $this->objFromFixture('Member', 'admin'); $admin->logIn(); + + $this->waitUntilIndexingFinished(); } @@ -55,6 +62,8 @@ class TranslatableSearchFormTest extends FunctionalTest { $translatedPublishedPage->write(); $translatedPublishedPage->publish('Stage', 'Live'); + $this->waitUntilIndexingFinished(); + // Translatable::set_current_locale() can't be used because the context // from the holder is not present here - we set the language explicitly // through a pseudo GET variable in getResults() @@ -89,4 +98,4 @@ class TranslatableSearchFormTest extends FunctionalTest { } } -?> \ No newline at end of file +?>