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
This commit is contained in:
Mateusz Uzdowski 2010-08-31 05:52:48 +00:00 committed by Sam Minnee
parent 0e156f1759
commit 2a708d9afa

View File

@ -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 {
}
}
?>
?>