|
@@ -23,6 +23,7 @@ class ExtractorTest extends TestCase
|
|
|
'strategies' => [
|
|
|
'metadata' => [
|
|
|
\Knuckles\Scribe\Extracting\Strategies\Metadata\GetFromDocBlocks::class,
|
|
|
+ \Knuckles\Scribe\Tests\Fixtures\TestCustomEndpointMetadata::class,
|
|
|
],
|
|
|
'urlParameters' => [
|
|
|
\Knuckles\Scribe\Extracting\Strategies\UrlParameters\GetFromLaravelAPI::class,
|
|
@@ -264,6 +265,14 @@ class ExtractorTest extends TestCase
|
|
|
$this->assertSame('Name of the location', $parsed->bodyParameters['name']->description);
|
|
|
}
|
|
|
|
|
|
+ /** @test */
|
|
|
+ public function endpoint_metadata_supports_custom_declarations()
|
|
|
+ {
|
|
|
+ $route = $this->createRoute('POST', '/api/test', 'dummy');
|
|
|
+ $parsed = $this->generator->processRoute($route);
|
|
|
+ $this->assertSame('some custom metadata', $parsed->metadata->custom['myProperty']);
|
|
|
+ }
|
|
|
+
|
|
|
public function createRoute(string $httpMethod, string $path, string $controllerMethod, $register = false, $class = TestController::class)
|
|
|
{
|
|
|
return new Route([$httpMethod], $path, ['uses' => $class . "@$controllerMethod"]);
|