@@ -87,7 +87,7 @@ public function testSapiWindowsVt100SupportWarnsOnInvalidInputType()
87
87
$ this ->markTestSkipped ('Windows only test ' );
88
88
}
89
89
90
- $ this ->setExpectedException ('PHPUnit_Framework_Error_Warning ' , 'expects parameter 1 to be resource ' );
90
+ $ this ->setExpectedException ('PHPUnit\Framework\Error\Warning ' , 'expects parameter 1 to be resource ' );
91
91
sapi_windows_vt100_support ('foo ' , true );
92
92
}
93
93
@@ -100,7 +100,7 @@ public function testSapiWindowsVt100SupportWarnsOnInvalidStream()
100
100
$ this ->markTestSkipped ('Windows only test ' );
101
101
}
102
102
103
- $ this ->setExpectedException ('PHPUnit_Framework_Error_Warning ' , 'was not able to analyze the specified stream ' );
103
+ $ this ->setExpectedException ('PHPUnit\Framework\Error\Warning ' , 'was not able to analyze the specified stream ' );
104
104
sapi_windows_vt100_support (fopen ('php://memory ' , 'wb ' ), true );
105
105
}
106
106
@@ -119,7 +119,20 @@ public function testStreamIsatty()
119
119
*/
120
120
public function testStreamIsattyWarnsOnInvalidInputType ()
121
121
{
122
- $ this ->setExpectedException ('PHPUnit_Framework_Error_Warning ' , 'expects parameter 1 to be resource ' );
122
+ $ this ->setExpectedException ('PHPUnit\Framework\Error\Warning ' , 'expects parameter 1 to be resource ' );
123
123
stream_isatty ('foo ' );
124
124
}
125
+
126
+ public function setExpectedException ($ exception , $ message = '' , $ code = null )
127
+ {
128
+ if (!class_exists ('PHPUnit\Framework\Error\Notice ' )) {
129
+ $ exception = str_replace ('PHPUnit \\Framework \\Error \\' , 'PHPUnit_Framework_Error_ ' , $ exception );
130
+ }
131
+ if (method_exists ($ this , 'expectException ' )) {
132
+ $ this ->expectException ($ exception );
133
+ $ this ->expectExceptionMessage ($ message );
134
+ } else {
135
+ parent ::setExpectedException ($ exception , $ message , $ code );
136
+ }
137
+ }
125
138
}
0 commit comments