Browse Source

Fixed FixtureInjector method compatibility

Jeremy Harris 8 years ago
parent
commit
661bec0659
1 changed files with 2 additions and 80 deletions
  1. 2 80
      src/TestSuite/Fixture/FixtureInjector.php

+ 2 - 80
src/TestSuite/Fixture/FixtureInjector.php

@@ -24,24 +24,18 @@ if (class_exists('PHPUnit_Runner_Version')) {
     if (!class_exists('PHPUnit\Framework\TestSuite')) {
         class_alias('PHPUnit_Framework_TestSuite', 'PHPUnit\Framework\TestSuite');
     }
-    if (!class_exists('PHPUnit\Framework\AssertionFailedError')) {
-        class_alias('PHPUnit_Framework_AssertionFailedError', 'PHPUnit\Framework\AssertionFailedError');
-    }
 }
 
 use Cake\TestSuite\TestCase;
-use Exception;
-use PHPUnit\Framework\AssertionFailedError;
+use PHPUnit\Framework\BaseTestListener;
 use PHPUnit\Framework\Test;
-use PHPUnit\Framework\TestListener;
 use PHPUnit\Framework\TestSuite;
-use PHPUnit\Framework\Warning;
 
 /**
  * Test listener used to inject a fixture manager in all tests that
  * are composed inside a Test Suite
  */
-class FixtureInjector implements TestListener
+class FixtureInjector extends BaseTestListener
 {
 
     /**
@@ -101,66 +95,6 @@ class FixtureInjector implements TestListener
     }
 
     /**
-     * Not Implemented
-     *
-     * @param \PHPUnit\Framework\Test $test The test to add errors from.
-     * @param \Exception $e The exception
-     * @param float $time current time
-     * @return void
-     */
-    public function addError(Test $test, Exception $e, $time)
-    {
-    }
-
-    /**
-     * Not Implemented
-     *
-     * @param \PHPUnit\Framework\Test $test The test to add warnings from.
-     * @param \PHPUnit\Framework\Warning $e The warning
-     * @param float $time current time
-     * @return void
-     */
-    public function addWarning(Test $test, Warning $e, $time)
-    {
-    }
-
-    /**
-     * Not Implemented
-     *
-     * @param \PHPUnit\Framework\Test $test The test case
-     * @param \PHPUnit\Framework\AssertionFailedError $e The failed assertion
-     * @param float $time current time
-     * @return void
-     */
-    public function addFailure(Test $test, AssertionFailedError $e, $time)
-    {
-    }
-
-    /**
-     * Not Implemented
-     *
-     * @param \PHPUnit\Framework\Test $test The test case
-     * @param \Exception $e The incomplete test error.
-     * @param float $time current time
-     * @return void
-     */
-    public function addIncompleteTest(Test $test, Exception $e, $time)
-    {
-    }
-
-    /**
-     * Not Implemented
-     *
-     * @param \PHPUnit\Framework\Test $test The test case
-     * @param \Exception $e Skipped test exception
-     * @param float $time current time
-     * @return void
-     */
-    public function addSkippedTest(Test $test, Exception $e, $time)
-    {
-    }
-
-    /**
      * Adds fixtures to a test case when it starts.
      *
      * @param \PHPUnit\Framework\Test $test The test case
@@ -188,16 +122,4 @@ class FixtureInjector implements TestListener
             $this->_fixtureManager->unload($test);
         }
     }
-
-    /**
-     * Not Implemented
-     *
-     * @param \PHPUnit\Framework\Test $test The test case
-     * @param \Exception $e The exception to track
-     * @param float $time current time
-     * @return void
-     */
-    public function addRiskyTest(Test $test, Exception $e, $time)
-    {
-    }
 }