Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sonrac committed Apr 13, 2022
1 parent 68dadee commit fa7fa35
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '7.2'
coverage: 'none'

- name: Checkout code
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.phpunit.result.cache
composer.lock
vendor/
docker-compose.override.yml
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
php7:
image: php:7.2-fpm
user: "1000:1000"
working_dir: /var/www/html
volumes:
- ./:/var/www/html
php8.0:
image: php:8.0-fpm
user: "1000:1000"
working_dir: /var/www/html
volumes:
- ./:/var/www/html
php8.1:
image: php:8.1-fpm
working_dir: /var/www/html
user: "1000:1000"
volumes:
- ./:/var/www/html

10 changes: 5 additions & 5 deletions tests/Annotations/OpenApiRouteLoaderAnnotationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ public function testPriority(): void
$routes = $routeLoader->__invoke();

$expectedRoutes = [];
$expectedRoutes[] = (new Route('/bar'))
$expectedRoutes['/bar'] = (new Route('/bar'))
->setMethods('GET')
->setDefault('_controller', PriorityController::class.'::bar');
$expectedRoutes[] = (new Route('/foo'))
$expectedRoutes['/foo'] = (new Route('/foo'))
->setMethods('GET')
->setDefault('_controller', PriorityController::class.'::foo');
$expectedRoutes[] = (new Route('/{catchall}'))
$expectedRoutes['/{catchall}'] = (new Route('/{catchall}'))
->setMethods('GET')
->setDefault('_controller', PriorityController::class.'::catchall');

$index = 0;
foreach ($routes as $route) {
$this->assertEquals($route, $expectedRoutes[$index++]);
$this->assertArrayHasKey($route->getPath(), $expectedRoutes);
$this->assertEquals($route, $expectedRoutes[$route->getPath()]);
}
}

Expand Down

0 comments on commit fa7fa35

Please sign in to comment.