From a1044749b08aaf709fad68ed184cfbec7187650c Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 01:30:10 +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. (from r110262) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112840 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 +?>