File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
tests/unit/Framework/MockObject Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,16 @@ final public function testMethodCanBeConfiguredToThrowAnException(): void
204
204
$ this ->fail ();
205
205
}
206
206
207
+ public function testMethodWithNeverReturnTypeDeclarationThrowsException (): void
208
+ {
209
+ $ double = $ this ->createTestDouble (InterfaceWithNeverReturningMethod::class);
210
+
211
+ $ this ->expectException (NeverReturningMethodException::class);
212
+ $ this ->expectExceptionMessage ('Method PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod::m() is declared to never return ' );
213
+
214
+ $ double ->m ();
215
+ }
216
+
207
217
#[TestDox('Original __clone() method is not called by default when test double object is cloned ' )]
208
218
public function testOriginalCloneMethodIsNotCalledByDefaultWhenTestDoubleObjectIsCloned (): void
209
219
{
@@ -223,16 +233,6 @@ public function testOriginalCloneMethodCanOptionallyBeCalledWhenTestDoubleObject
223
233
clone $ double ;
224
234
}
225
235
226
- public function testThrowsExceptionWhenMethodWithNeverReturnTypeDeclarationIsCalled (): void
227
- {
228
- $ double = $ this ->createTestDouble (InterfaceWithNeverReturningMethod::class);
229
-
230
- $ this ->expectException (NeverReturningMethodException::class);
231
- $ this ->expectExceptionMessage ('Method PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod::m() is declared to never return ' );
232
-
233
- $ double ->m ();
234
- }
235
-
236
236
/**
237
237
* @psalm-template RealInstanceType of object
238
238
*
You can’t perform that action at this time.
0 commit comments