File: fix-build-with-newer-phpunit.diff

package info (click to toggle)
php-react-promise 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 460 kB
  • sloc: php: 4,353; makefile: 16
file content (26 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# DP: fix build with newer PHPUnit which uses namespaces

--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -2,7 +2,7 @@
 
 namespace React\Promise;
 
-class TestCase extends \PHPUnit_Framework_TestCase
+class TestCase extends \PHPUnit\Framework\TestCase
 {
     public function expectCallableExactly($amount)
     {
@@ -40,4 +40,12 @@ class TestCase extends \PHPUnit_Framewor
             ->getMockBuilder('React\\Promise\Stub\CallableStub')
             ->getMock();
     }
+
+    /* PHPUnit ist ein Testkäse */
+    public function setExpectedException($whatever, $str=NULL)
+    {
+        $this->expectException($whatever);
+        if ($str !== NULL)
+            $this->expectExceptionMessage($str);
+    }
 }