diff --git a/code/tests/MisdirectionFunctionalTests.php b/code/tests/MisdirectionFunctionalTests.php index 69e25a2..4883b2f 100644 --- a/code/tests/MisdirectionFunctionalTests.php +++ b/code/tests/MisdirectionFunctionalTests.php @@ -88,15 +88,18 @@ public function testRequestFilter() { // Instantiate a fallback to use. - $second->deleteFromStage('Live'); - $second->deleteFromStage('Stage'); $first->Fallback = 'Nearest'; $first->writeToStage('Stage'); $first->writeToStage('Live'); - // Determine whether the fallback is matched. + // The database needs to be cleaned up to prevent further testing conflict. + $second->deleteFromStage('Live'); + $second->deleteFromStage('Stage'); $mapping->delete(); + + // Determine whether the fallback is matched. + $response = $this->get('wrong/page'); $this->assertEquals($response->getStatusCode(), 303); $this->assertEquals($response->getHeader('Location'), '/wrong/?direct=1');