diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf694cb1..44477a5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,9 +61,8 @@ jobs: key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer- - - name: Install PHPUnit 9 for Symfony 5.4 - if: "matrix.symfony == '5.4.*'" - run: composer require --dev --no-update "phpunit/phpunit=^9.0" + - name: Install PHPUnit 10 + run: composer require --dev --no-update "phpunit/phpunit=^10.0" - name: Install dependencies run: | @@ -76,21 +75,20 @@ jobs: composer require symfony/browser-kit=${{ matrix.symfony }} --no-update composer require vlucas/phpdotenv --no-update composer require codeception/module-asserts="3.*" --no-update - composer require codeception/module-doctrine2="3.*" --no-update + composer require codeception/module-doctrine="3.*" --no-update composer update --prefer-dist --no-progress --no-dev - name: Validate composer.json and composer.lock run: composer validate working-directory: framework-tests - - name: Install PHPUnit 10 in framework-tests for Symfony 6.4 and 7.0 - if: "matrix.symfony == '6.4.*' || matrix.symfony == '7.0.*'" - run: composer require --dev --no-update "phpunit/phpunit=^10.0" + - name: Install PHPUnit 10 in framework-tests + run: composer require --dev --no-update "phpunit/phpunit=^10.0" working-directory: framework-tests - name: Install Symfony Sample run: | - composer remove codeception/codeception codeception/module-asserts codeception/module-doctrine2 codeception/lib-innerbrowser codeception/module-symfony --dev --no-update + composer remove codeception/codeception codeception/module-asserts codeception/module-doctrine codeception/lib-innerbrowser codeception/module-symfony --dev --no-update composer update --no-progress working-directory: framework-tests diff --git a/composer.json b/composer.json index 5e148b68..1421734d 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "codeception/module-asserts": "^3.0", - "codeception/module-doctrine2": "^3.0", + "codeception/module-doctrine": "^3.1", "doctrine/orm": "^2.10", "symfony/browser-kit": "^5.4 | ^6.4 | ^7.0", "symfony/cache": "^5.4 | ^6.4 | ^7.0", diff --git a/src/Codeception/Module/Symfony.php b/src/Codeception/Module/Symfony.php index 9f3b5e62..13a9f6df 100644 --- a/src/Codeception/Module/Symfony.php +++ b/src/Codeception/Module/Symfony.php @@ -62,7 +62,7 @@ * and [HttpKernel Component](https://symfony.com/doc/current/components/http_kernel.html) to emulate requests and test response. * * * Access Symfony services through the dependency injection container: [`$I->grabService(...)`](#grabService) - * * Use Doctrine to test against the database: `$I->seeInRepository(...)` - see [Doctrine Module](https://codeception.com/docs/modules/Doctrine2) + * * Use Doctrine to test against the database: `$I->seeInRepository(...)` - see [Doctrine Module](https://codeception.com/docs/modules/Doctrine) * * Assert that emails would have been sent: [`$I->seeEmailIsSent()`](#seeEmailIsSent) * * Tests are wrapped into Doctrine transaction to speed them up. * * Symfony Router can be cached between requests to speed up testing. @@ -118,7 +118,7 @@ * enabled: * - Symfony: * part: services - * - Doctrine2: + * - Doctrine: * depends: Symfony * - WebDriver: * url: http://example.com diff --git a/src/Codeception/Module/Symfony/RouterAssertionsTrait.php b/src/Codeception/Module/Symfony/RouterAssertionsTrait.php index 80501555..699b23b1 100644 --- a/src/Codeception/Module/Symfony/RouterAssertionsTrait.php +++ b/src/Codeception/Module/Symfony/RouterAssertionsTrait.php @@ -117,6 +117,7 @@ public function seeCurrentRouteIs(string $routeName, array $params = []): void } $uri = explode('?', $this->grabFromCurrentUrl())[0]; + $uri = explode('#', $uri)[0]; $match = []; try { $match = $router->match($uri); @@ -147,6 +148,7 @@ public function seeInCurrentRoute(string $routeName): void } $uri = explode('?', $this->grabFromCurrentUrl())[0]; + $uri = explode('#', $uri)[0]; $matchedRouteName = ''; try { $matchedRouteName = (string)$router->match($uri)['_route']; @@ -161,4 +163,4 @@ protected function grabRouterService(): RouterInterface { return $this->grabService('router'); } -} \ No newline at end of file +}