From e3fd1e43b1df767b1a372c7602e5e0f1c104ccb2 Mon Sep 17 00:00:00 2001 From: Aaron Gustavo Nieves <64917965+TavoNiievez@users.noreply.github.com> Date: Mon, 11 Mar 2024 21:12:08 -0500 Subject: [PATCH 1/3] Fix CI --- .github/workflows/main.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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 From 666c35c8647d3d7500428aa09213cbe763b2aed6 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Tue, 12 Mar 2024 03:24:32 +0100 Subject: [PATCH 2/3] Renaming Doctrine2 to Doctrine (#184) * Renaming Doctrine2 -> Doctrine Co-authored-by: Dieter Beck --- composer.json | 2 +- src/Codeception/Module/Symfony.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 From e45d5af6ea7714d5d53acac33df48781b23afd2d Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 15 Mar 2024 18:44:12 +0000 Subject: [PATCH 3/3] Ignore fragments when checking routes (#185) --- src/Codeception/Module/Symfony/RouterAssertionsTrait.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 +}