From 3cf05e793d8d44eb97d40866493a9b759042e34c Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 29 Apr 2024 16:31:15 +0200 Subject: [PATCH] Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder` --- Tests/Loader/ObjectLoaderTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tests/Loader/ObjectLoaderTest.php b/Tests/Loader/ObjectLoaderTest.php index 51f7045a..62cb6b9f 100644 --- a/Tests/Loader/ObjectLoaderTest.php +++ b/Tests/Loader/ObjectLoaderTest.php @@ -81,9 +81,8 @@ public function testExceptionOnBadMethod() public function testExceptionOnMethodNotReturningCollection() { $this->expectException(\LogicException::class); - $service = $this->getMockBuilder(\stdClass::class) - ->addMethods(['loadRoutes']) - ->getMock(); + + $service = $this->createMock(CustomRouteLoader::class); $service->expects($this->once()) ->method('loadRoutes') ->willReturn('NOT_A_COLLECTION'); @@ -109,6 +108,11 @@ protected function getObject(string $id): object } } +interface CustomRouteLoader +{ + public function loadRoutes(); +} + class TestObjectLoaderRouteService { private $collection;