diff --git a/tests/unit/Framework/MockObject/GeneratorTest.php b/tests/unit/Framework/MockObject/GeneratorTest.php index fd754fc2922..d9e0c092681 100644 --- a/tests/unit/Framework/MockObject/GeneratorTest.php +++ b/tests/unit/Framework/MockObject/GeneratorTest.php @@ -142,7 +142,19 @@ public function testGetMockForTraitStubbingAbstractMethod(): void $this->assertTrue(\method_exists($mock, 'doSomething')); } - public function testGetMockForSingletonWithReflectionSuccess(): void + public function testGetMockForTraitWithNonExistantTrait(): void + { + $this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class); + $mock = $this->generator->getMockForTrait('NonExistantTrait'); + } + + public function testGetObjectForTraitWithNonExistantTrait(): void + { + $this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class); + $mock = $this->generator->getObjectForTrait('NonExistantTrait'); + } + + public function testGetMockForSingletonWithReflectionSuccess(): void { $mock = $this->generator->getMock(SingletonClass::class, ['doSomething'], [], '', false);