Permalink
Browse files

BUGFIX Rebuilding test database for postgresql in SearchFormTest and …

…TranslatableSearchFormTest to avoid stale index information in the database (from r103803)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112161 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 94158ef commit a40d190161477c0af68abdd5ca1bdb0261bd3eef @sminnee sminnee committed Oct 13, 2010
Showing with 18 additions and 0 deletions.
  1. +9 −0 tests/search/SearchFormTest.php
  2. +9 −0 tests/search/TranslatableSearchFormTest.php
@@ -24,6 +24,15 @@ class SearchFormTest extends FunctionalTest {
),
);
+ function setUpOnce() {
+ // HACK Postgres doesn't refresh TSearch indexes when the schema changes after CREATE TABLE
+ if(is_a(DB::getConn(), 'PostgreSQLDatabase')) {
+ self::kill_temp_db();
+ }
+
+ parent::setUpOnce();
+ }
+
function setUp() {
parent::setUp();
@@ -22,6 +22,15 @@ class TranslatableSearchFormTest extends FunctionalTest {
),
);
+ function setUpOnce() {
+ // HACK Postgres doesn't refresh TSearch indexes when the schema changes after CREATE TABLE
+ if(is_a(DB::getConn(), 'PostgreSQLDatabase')) {
+ self::kill_temp_db();
+ }
+
+ parent::setUpOnce();
+ }
+
function setUp() {
parent::setUp();

0 comments on commit a40d190

Please sign in to comment.