From 0c8568037168f95da455d21febcbce1945169064 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Mon, 3 Feb 2014 15:32:58 -0800 Subject: [PATCH] Support PHPUnit 3.8+ compatibility Summary: PHPUnit 3.8+ adds a method to its PHPUnit_Framework_TestListener called addRiskyTest(). Need to stub it out to avoid "must implement this interface method" fatals when using 3.8+ Test Plan: Reviewers: CC: Task ID: # Blame Rev: --- dev/SapphireTestReporter.php | 12 ++++++++++++ dev/SilverStripeListener.php | 12 ++++++++++++ dev/TeamCityListener.php | 12 ++++++++++++ dev/TestListener.php | 12 ++++++++++++ 4 files changed, 48 insertions(+) diff --git a/dev/SapphireTestReporter.php b/dev/SapphireTestReporter.php index 84da76c72..602520d0e 100644 --- a/dev/SapphireTestReporter.php +++ b/dev/SapphireTestReporter.php @@ -300,6 +300,18 @@ class SapphireTestReporter implements PHPUnit_Framework_TestListener { } } + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } + /** * Trys to get the original exception thrown by the test on failure/error * to enable us to give a bit more detail about the failure/error diff --git a/dev/SilverStripeListener.php b/dev/SilverStripeListener.php index 009591f82..0d6b7ceb8 100644 --- a/dev/SilverStripeListener.php +++ b/dev/SilverStripeListener.php @@ -42,4 +42,16 @@ class SilverStripeListener implements PHPUnit_Framework_TestListener { public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) { } + + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } } diff --git a/dev/TeamCityListener.php b/dev/TeamCityListener.php index 7af8a6c52..48e017594 100644 --- a/dev/TeamCityListener.php +++ b/dev/TeamCityListener.php @@ -58,4 +58,16 @@ class TeamCityListener implements PHPUnit_Framework_TestListener { $message = $this->escape($e->getMessage()); echo "##teamcity[testIgnored name='{$class}.{$test->getName()}' message='$message']\n"; } + + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } } diff --git a/dev/TestListener.php b/dev/TestListener.php index 5494dfd89..4c0115004 100644 --- a/dev/TestListener.php +++ b/dev/TestListener.php @@ -38,6 +38,18 @@ class SS_TestListener implements PHPUnit_Framework_TestListener { $this->class->tearDownOnce(); } + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } + /** * @param String Classname * @return boolean