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
This commit is contained in:
Sam Minnee 2010-10-19 01:30:10 +00:00
parent d0c9fe908a
commit a1044749b0

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