Browse Source

Update FixtureInjector with addWarning

PHPUnit has just added the `addWarning` signature to the `PHPUnit_Framework_TestListener` interface, which caused the CakePHP fixtures to fail with the latest PHPUnit.  

This patch implements a _Not Implemented_ version of the method signature to prevent the following error

```
PHP Fatal error:  Class Cake\TestSuite\Fixture\FixtureInjector contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPUnit_Framework_TestListener::addWarning) in ./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php on line 174
```
Dave Baker 10 years ago
parent
commit
eaca7ca34f
1 changed files with 14 additions and 0 deletions
  1. 14 0
      src/TestSuite/Fixture/FixtureInjector.php

+ 14 - 0
src/TestSuite/Fixture/FixtureInjector.php

@@ -21,6 +21,8 @@ use PHPUnit_Framework_AssertionFailedError;
 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
@@ -97,6 +99,18 @@ class FixtureInjector implements PHPUnit_Framework_TestListener
     /**
      * Not Implemented
      *
+     * @param \PHPUnit_Framework_Test $test The test to add warnings from.
+     * @param \PHPUnit_Warning $e The warning
+     * @param float $time current time
+     * @return void
+     */
+    public function addWarning(PHPUnit_Framework_Test $test, PHPUnit_Framework_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