From d207e8af34d09af2fdcd9e4b812d93a9df30ea17 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 1 Nov 2012 12:34:29 +0100 Subject: [PATCH] MINOR Manually marking test run in DMSDocumentTest to avoid triggering solr reindex Should really be handled by SapphireTest, tearDownOnce() is technically still part of the test run, but this is a quick enough fix --- tests/DMSDocumentTest.php | 4 ++++ tests/DMSEmbargoTest.php | 4 ++++ tests/DMSTagTest.php | 4 ++++ tests/DMSTest.php | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/tests/DMSDocumentTest.php b/tests/DMSDocumentTest.php index 21c72b7..7389a98 100644 --- a/tests/DMSDocumentTest.php +++ b/tests/DMSDocumentTest.php @@ -4,6 +4,8 @@ class DMSDocumentTest extends SapphireTest { static $fixture_file = "dms/tests/dmstest.yml"; function tearDownOnce() { + self::$is_running_test = true; + $d = DataObject::get("DMSDocument"); foreach($d as $d1) { $d1->delete(); @@ -12,6 +14,8 @@ class DMSDocumentTest extends SapphireTest { foreach($t as $t1) { $t1->delete(); } + + self::$is_running_test = $this->originalIsRunningTest; } function testPageRelations() { diff --git a/tests/DMSEmbargoTest.php b/tests/DMSEmbargoTest.php index fe71f8a..ef66148 100644 --- a/tests/DMSEmbargoTest.php +++ b/tests/DMSEmbargoTest.php @@ -4,6 +4,8 @@ class DMSEmbargoTest extends SapphireTest { static $fixture_file = "dms/tests/dmsembargotest.yml"; function tearDownOnce() { + self::$is_running_test = true; + $d = DataObject::get("DMSDocument"); foreach($d as $d1) { $d1->delete(); @@ -12,6 +14,8 @@ class DMSEmbargoTest extends SapphireTest { foreach($t as $t1) { $t1->delete(); } + + self::$is_running_test = $this->originalIsRunningTest; } function createFakeHTTPRequest($id) { diff --git a/tests/DMSTagTest.php b/tests/DMSTagTest.php index bd47fdb..1e4d747 100644 --- a/tests/DMSTagTest.php +++ b/tests/DMSTagTest.php @@ -2,6 +2,8 @@ class DMSTagTest extends SapphireTest { function tearDownOnce() { + self::$is_running_test = true; + $d = DataObject::get("DMSDocument"); foreach($d as $d1) { $d1->delete(); @@ -10,6 +12,8 @@ class DMSTagTest extends SapphireTest { foreach($t as $t1) { $t1->delete(); } + + self::$is_running_test = $this->originalIsRunningTest; } function testAddingTags() { diff --git a/tests/DMSTest.php b/tests/DMSTest.php index 73f582b..8ff53d8 100644 --- a/tests/DMSTest.php +++ b/tests/DMSTest.php @@ -24,6 +24,8 @@ class DMSTest extends FunctionalTest { function tearDown() { parent::tearDown(); + self::$is_running_test = true; + $d = DataObject::get("DMSDocument"); foreach($d as $d1) { $d1->delete(); @@ -39,6 +41,8 @@ class DMSTest extends FunctionalTest { //set the old DMS folder back again DMS::$dmsFolder = self::$dmsFolderOld; DMS::$dmsFolderSize = self::$dmsFolderSizeOld; + + self::$is_running_test = $this->originalIsRunningTest; } public function delete($path) {