From 3951b0ac846adcb33d7b7ae439b3e7e0bd640162 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Thu, 4 Jun 2009 06:46:30 +0000 Subject: [PATCH] BUGFIX: If a FunctionalTest fails in the middle of a get() or post() call, return an error other than the controller stack failing. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@78413 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/TestSession.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/TestSession.php b/dev/TestSession.php index 158554b06..5b831ee39 100644 --- a/dev/TestSession.php +++ b/dev/TestSession.php @@ -29,6 +29,10 @@ class TestSession { } function __destruct() { + // Shift off anything else that's on the stack. This can happen if something throws + // an exception that causes a premature TestSession::__destruct() call + while(Controller::curr() != $this->controller) Controller::curr()->popCurrent(); + $this->controller->popCurrent(); }