Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Update composer packages
  • Loading branch information
uderline committed Feb 22, 2022
1 parent 885b7ba commit fc96c6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
],
"require": {
"php": ">=8.0",
"symfony/finder": "^5.3",
"symfony/http-foundation": "^5.3"
"symfony/finder": "^6.0",
"symfony/http-foundation": "^6.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 5 additions & 1 deletion tests/GenerateHttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use OpenApiGenerator\Attributes\GET;
use OpenApiGenerator\Attributes\Parameter;
use OpenApiGenerator\Attributes\PathParameter;
use OpenApiGenerator\Attributes\Property;
use OpenApiGenerator\Attributes\RequestBody;
use OpenApiGenerator\Attributes\Response;
Expand Down Expand Up @@ -34,13 +35,16 @@ public function testAppend(): void
$expectedParameter->setName('id');
$expectedParameter->setParamType('float');

$expectedPathParameter = new PathParameter('otherParameter', description: 'Parameter which is not used as an argument in this method');

$schema = new Schema();
$schema->addProperty(new Property('string', 'prop1'));
$requestBody = new RequestBody();
$requestBody->setSchema($schema);

$expectedRoute = new GET('/path/{id}', ['Dummy'], 'Dummy path');
$expectedRoute = new GET('/path/{id}/{otherParameter}', ['Dummy'], 'Dummy path');
$expectedRoute->addParam($expectedParameter);
$expectedRoute->addParam($expectedPathParameter);
$expectedRoute->setRequestBody($requestBody);
$expectedRoute->setResponse(new Response());

Expand Down
2 changes: 1 addition & 1 deletion tests/PathMethodBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function testSetRoute(): void
$route = new Route(Route::GET, "/path");

$builder = new PathMethodBuilder();
$builder->setRoute($route, [[new Parameter("desc")]]);
$builder->setRoute($route, [new Parameter("desc")]);

// Use a reflection to avoid testing PathMethodBuilder::getRoute
$reflection = new ReflectionClass($builder);
Expand Down

0 comments on commit fc96c6a

Please sign in to comment.