getFromTags($tags); $this->assertArraySubset([ 'location_id' => [ 'type' => 'string', 'required' => true, 'description' => 'The id of the location.', ], 'user_id' => [ 'type' => 'string', 'required' => true, 'description' => 'The id of the user.', 'example' => 'me', ], 'page' => [ 'type' => 'integer', 'required' => false, 'description' => 'The page number.', 'example' => 4, ], 'with_type' => [ 'type' => 'number', 'required' => false, 'description' => '', 'example' => 13.0, ], 'with_list_type' => [ 'type' => 'integer[]', 'required' => false, 'description' => '', ], 'fields' => [ 'type' => 'string[]', 'required' => false, 'description' => 'The fields.', 'example' => ['age', 'name'] ], 'filters' => [ 'type' => 'object', 'required' => false, 'description' => 'The filters.', ], 'filters.class' => [ 'type' => 'number', 'required' => false, 'description' => 'Class.', 'example' => 11.0 ], 'filters.other' => [ 'type' => 'string', 'required' => true, 'description' => 'Other things.', ], 'noExampleNoDescription' => [ 'type' => 'string', 'required' => false, 'description' => '', 'example' => null ], 'noExample' => [ 'type' => 'string', 'required' => false, 'description' => 'Something', 'example' => null ], ], $results); } /** @test */ public function can_fetch_from_form_request_method_argument() { $methodName = 'withFormRequestParameter'; $method = new \ReflectionMethod(TestController::class, $methodName); $route = new Route(['POST'], "/$methodName", ['uses' => [TestController::class, $methodName]]); $strategy = new GetFromQueryParamTag(new DocumentationConfig([])); $results = $strategy->getParametersFromDocBlockInFormRequestOrMethod($route, $method); $this->assertArraySubset([ 'location_id' => [ 'required' => true, 'description' => 'The id of the location.', ], 'user_id' => [ 'required' => true, 'description' => 'The id of the user.', 'example' => 'me', ], 'page' => [ 'required' => true, 'description' => 'The page number.', 'example' => '4', ], ], $results); } }