Skip to content

Commit 47859ba

Browse files
[Tests] Remove $this occurrences in future static data providers
1 parent 14a79d8 commit 47859ba

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

Tests/Middleware/HandleMessageMiddlewareTest.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,28 @@ public function testItAddsHandledStamps(array $handlers, array $expectedStamps,
6969

7070
public function itAddsHandledStampsProvider(): iterable
7171
{
72-
$first = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']);
73-
$first->method('__invoke')->willReturn('first result');
72+
$first = new class() extends HandleMessageMiddlewareTestCallable {
73+
public function __invoke()
74+
{
75+
return 'first result';
76+
}
77+
};
7478
$firstClass = \get_class($first);
7579

76-
$second = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']);
77-
$second->method('__invoke')->willReturn(null);
80+
$second = new class() extends HandleMessageMiddlewareTestCallable {
81+
public function __invoke()
82+
{
83+
return null;
84+
}
85+
};
7886
$secondClass = \get_class($second);
7987

80-
$failing = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']);
81-
$failing->method('__invoke')->will($this->throwException(new \Exception('handler failed.')));
88+
$failing = new class() extends HandleMessageMiddlewareTestCallable {
89+
public function __invoke()
90+
{
91+
throw new \Exception('handler failed.');
92+
}
93+
};
8294

8395
yield 'A stamp is added' => [
8496
[$first],

0 commit comments

Comments
 (0)