Skip to content

Commit 016111e

Browse files
authored
Add debug info to action wrapper (#47)
1 parent bed3a91 commit 016111e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/MiddlewareFactory.php

+7
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ public function process(
9393

9494
throw new InvalidMiddlewareDefinitionException($this->callback);
9595
}
96+
97+
public function __debugInfo()
98+
{
99+
return [
100+
'callback' => $this->callback,
101+
];
102+
}
96103
};
97104
}
98105

tests/MiddlewareFactoryTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public function testCreateFromArray(): void
4343
$this->createMock(RequestHandlerInterface::class)
4444
)->getHeaderLine('test')
4545
);
46+
self::assertSame(
47+
[TestController::class, 'index'],
48+
$middleware->__debugInfo()['callback']
49+
);
4650
}
4751

4852
public function testCreateFromClosureResponse(): void

0 commit comments

Comments
 (0)