Skip to content

Commit fa7fa35

Browse files
committed
fix tests
1 parent 68dadee commit fa7fa35

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: '8.1'
21+
php-version: '7.2'
2222
coverage: 'none'
2323

2424
- name: Checkout code

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.phpunit.result.cache
22
composer.lock
33
vendor/
4+
docker-compose.override.yml

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
services:
2+
php7:
3+
image: php:7.2-fpm
4+
user: "1000:1000"
5+
working_dir: /var/www/html
6+
volumes:
7+
- ./:/var/www/html
8+
php8.0:
9+
image: php:8.0-fpm
10+
user: "1000:1000"
11+
working_dir: /var/www/html
12+
volumes:
13+
- ./:/var/www/html
14+
php8.1:
15+
image: php:8.1-fpm
16+
working_dir: /var/www/html
17+
user: "1000:1000"
18+
volumes:
19+
- ./:/var/www/html
20+

tests/Annotations/OpenApiRouteLoaderAnnotationsTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ public function testPriority(): void
112112
$routes = $routeLoader->__invoke();
113113

114114
$expectedRoutes = [];
115-
$expectedRoutes[] = (new Route('/bar'))
115+
$expectedRoutes['/bar'] = (new Route('/bar'))
116116
->setMethods('GET')
117117
->setDefault('_controller', PriorityController::class.'::bar');
118-
$expectedRoutes[] = (new Route('/foo'))
118+
$expectedRoutes['/foo'] = (new Route('/foo'))
119119
->setMethods('GET')
120120
->setDefault('_controller', PriorityController::class.'::foo');
121-
$expectedRoutes[] = (new Route('/{catchall}'))
121+
$expectedRoutes['/{catchall}'] = (new Route('/{catchall}'))
122122
->setMethods('GET')
123123
->setDefault('_controller', PriorityController::class.'::catchall');
124124

125-
$index = 0;
126125
foreach ($routes as $route) {
127-
$this->assertEquals($route, $expectedRoutes[$index++]);
126+
$this->assertArrayHasKey($route->getPath(), $expectedRoutes);
127+
$this->assertEquals($route, $expectedRoutes[$route->getPath()]);
128128
}
129129
}
130130

0 commit comments

Comments
 (0)