From 73798a8913a50a4bbb8370ef0dd8c2d3248ad0c2 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 20 Oct 2023 11:32:57 +0200 Subject: [PATCH] Rename test --- .../MockObject/TestDoubleTestCase.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/unit/Framework/MockObject/TestDoubleTestCase.php b/tests/unit/Framework/MockObject/TestDoubleTestCase.php index 83a88ce5642..15342b89b5b 100644 --- a/tests/unit/Framework/MockObject/TestDoubleTestCase.php +++ b/tests/unit/Framework/MockObject/TestDoubleTestCase.php @@ -204,6 +204,16 @@ final public function testMethodCanBeConfiguredToThrowAnException(): void $this->fail(); } + public function testMethodWithNeverReturnTypeDeclarationThrowsException(): void + { + $double = $this->createTestDouble(InterfaceWithNeverReturningMethod::class); + + $this->expectException(NeverReturningMethodException::class); + $this->expectExceptionMessage('Method PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod::m() is declared to never return'); + + $double->m(); + } + #[TestDox('Original __clone() method is not called by default when test double object is cloned')] public function testOriginalCloneMethodIsNotCalledByDefaultWhenTestDoubleObjectIsCloned(): void { @@ -223,16 +233,6 @@ public function testOriginalCloneMethodCanOptionallyBeCalledWhenTestDoubleObject clone $double; } - public function testThrowsExceptionWhenMethodWithNeverReturnTypeDeclarationIsCalled(): void - { - $double = $this->createTestDouble(InterfaceWithNeverReturningMethod::class); - - $this->expectException(NeverReturningMethodException::class); - $this->expectExceptionMessage('Method PHPUnit\TestFixture\MockObject\InterfaceWithNeverReturningMethod::m() is declared to never return'); - - $double->m(); - } - /** * @psalm-template RealInstanceType of object *