Skip to content

Commit 1956c44

Browse files
authored
fix-method-map-class-name (#4)
1 parent a94b87b commit 1956c44

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/Traits/CanGetMethodNameByMessageTrait.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ private function getMethodMap(): MethodMapInterface
7070
if (!isset($this->methodMap)) {
7171
$this->methodMap = new MethodMapCacheDecorator(
7272
new MethodMapCollectionDecorator(
73-
new ClassNameMethodMap(self::class),
74-
new InterfaceMethodMap(self::class)
73+
new ClassNameMethodMap(static::class),
74+
new InterfaceMethodMap(static::class)
7575
),
7676
$this->getCache(),
77-
self::class
77+
static::class
7878
);
7979
}
8080

tests/AbstractMessageProcessorTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ public function processMessage(MessageInterface $message): MessageInterface
7171
);
7272
}
7373

74+
public function testProcess(): void
75+
{
76+
$processor = new class extends AbstractMessageProcessor{
77+
public function processMessage(MessageInterface $message): MessageInterface
78+
{
79+
return $message;
80+
}
81+
};
82+
self::assertInstanceOf(
83+
get_class($this->message),
84+
$processor->process($this->message)
85+
);
86+
}
87+
7488
public function testProcessFailByNoProcessingMethod(): void
7589
{
7690
$methodMap = $this->createMock(MethodMapInterface::class);

0 commit comments

Comments
 (0)