From 019328c99e931c4448379c95f7805b4392c14812 Mon Sep 17 00:00:00 2001 From: Jared King Date: Sat, 2 Dec 2017 19:25:55 -0600 Subject: [PATCH] update test listener to support phpunit 6 --- .gitignore | 3 ++- src/Test.php | 33 +++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 0939e8b..1b7ff07 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ Desktop.ini ._.DS_Store /build composer.lock -/config.php \ No newline at end of file +/config.php +/phpunit.xml \ No newline at end of file diff --git a/src/Test.php b/src/Test.php index 350c3a9..3830388 100644 --- a/src/Test.php +++ b/src/Test.php @@ -12,12 +12,13 @@ namespace Infuse; use Exception; -use PHPUnit_Framework_AssertionFailedError; -use PHPUnit_Framework_Test; -use PHPUnit_Framework_TestListener; -use PHPUnit_Framework_TestSuite; +use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Test as PHPUnitTest; +use PHPUnit\Framework\TestListener; +use PHPUnit\Framework\TestSuite; +use PHPUnit\Framework\Warning; -class Test implements PHPUnit_Framework_TestListener +class Test implements TestListener { /** * @var Application @@ -39,40 +40,44 @@ public function __construct() self::$app = new Application($config, Application::ENV_TEST); } - public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addError(PHPUnitTest $test, Exception $e, $time) { } - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + public function addFailure(PHPUnitTest $test, AssertionFailedError $e, $time) { } - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addIncompleteTest(PHPUnitTest $test, Exception $e, $time) { } - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addRiskyTest(PHPUnitTest $test, Exception $e, $time) { } - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addSkippedTest(PHPUnitTest $test, Exception $e, $time) { } - public function startTest(PHPUnit_Framework_Test $test) + public function addWarning(PHPUnitTest $test, Warning $e, $time) { } - public function endTest(PHPUnit_Framework_Test $test, $time) + public function startTest(PHPUnitTest $test) { } - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + public function endTest(PHPUnitTest $test, $time) + { + } + + public function startTestSuite(TestSuite $suite) { printf("\n\n%s:\n", $suite->getName()); } - public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + public function endTestSuite(TestSuite $suite) { } }