Skip to content

Commit 22f15a6

Browse files
committed
minor #54785 Remove calls to TestCase::iniSet() and calls to deprecated methods of MockBuilder (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Last round (before new deprecations 🙂). All deprecations [listed here](https://github.com/sebastianbergmann/phpunit/blob/main/DEPRECATIONS.md) should be gone. Commits ------- 4d5065ddd9 Remove calls to `TestCase::iniSet()` and calls to deprecated methods of `MockBuilder`
2 parents 198eb5b + 3cf05e7 commit 22f15a6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Tests/Loader/ObjectLoaderTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ public function testExceptionOnBadMethod()
8181
public function testExceptionOnMethodNotReturningCollection()
8282
{
8383
$this->expectException(\LogicException::class);
84-
$service = $this->getMockBuilder(\stdClass::class)
85-
->addMethods(['loadRoutes'])
86-
->getMock();
84+
85+
$service = $this->createMock(CustomRouteLoader::class);
8786
$service->expects($this->once())
8887
->method('loadRoutes')
8988
->willReturn('NOT_A_COLLECTION');
@@ -109,6 +108,11 @@ protected function getObject(string $id): object
109108
}
110109
}
111110

111+
interface CustomRouteLoader
112+
{
113+
public function loadRoutes();
114+
}
115+
112116
class TestObjectLoaderRouteService
113117
{
114118
private $collection;

0 commit comments

Comments
 (0)