Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Add setUp() and tearDown() template methods to PHPUnit_Framework_Te…

…stSuite.
  • Loading branch information...
commit 91caadd3e13cd55542542cb6148159e1712b72e4 1 parent f05d4fb
@sebastianbergmann authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 PHPUnit/Framework/TestSuite.php
View
24 PHPUnit/Framework/TestSuite.php
@@ -476,6 +476,7 @@ public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE
}
$result->startTestSuite($this);
+ $this->setUp();
foreach ($this->tests as $test) {
if ($result->shouldStop()) {
@@ -506,6 +507,7 @@ public function run(PHPUnit_Framework_TestResult $result = NULL, $filter = FALSE
}
}
+ $this->tearDown();
$result->endTestSuite($this);
return $result;
@@ -656,6 +658,28 @@ public function setSharedFixture($sharedFixture)
{
$this->sharedFixture = $sharedFixture;
}
+
+ /**
+ * Template Method that is called before the tests
+ * of this test suite are run.
+ *
+ * @access protected
+ * @since Method available since Release 3.1.0
+ */
+ protected function setUp()
+ {
+ }
+
+ /**
+ * Template Method that is called after the tests
+ * of this test suite have finished running.
+ *
+ * @access protected
+ * @since Method available since Release 3.1.0
+ */
+ protected function tearDown()
+ {
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.