Codeception / module-symfony

Codeception module for testing apps using Symfony framework
MIT License
88 stars 24 forks source link

Renaming Doctrine2 to Doctrine #184

Closed ThomasLandauer closed 6 months ago

W0rma commented 7 months ago

@ThomasLandauer I think this PR should also replace "codeception/module-doctrine2" with "codeception/module-doctrine".

Tests are currently failing because "codeception/module-doctrine2" is not compatible with ORMv3/DBALv4.

ThomasLandauer commented 7 months ago

Sorry, don't know what you mean. I changed just the docs.

W0rma commented 7 months ago

I mean all references to the composer package codeception/module-doctrine2:

Index: composer.json
<+>UTF-8
===================================================================
diff --git a/composer.json b/composer.json
--- a/composer.json (revision be24b2b64759e5b4dd83ca091ecfe49c26cecc5c)
+++ b/composer.json (date 1708610763372)
@@ -25,7 +25,7 @@
     },
     "require-dev": {
         "codeception/module-asserts": "^3.0",
-        "codeception/module-doctrine2": "^3.0",
+        "codeception/module-doctrine": "^3.0",
         "doctrine/orm": "^2.10",
         "symfony/browser-kit": "^5.4 | ^6.4 | ^7.0",
         "symfony/cache": "^5.4 | ^6.4 | ^7.0",
Index: .github/workflows/main.yml
<+>UTF-8
===================================================================
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
--- a/.github/workflows/main.yml    (revision be24b2b64759e5b4dd83ca091ecfe49c26cecc5c)
+++ b/.github/workflows/main.yml    (date 1708610763384)
@@ -76,7 +76,7 @@
           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
@@ -90,7 +90,7 @@

       - 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

By replacing them with codeception/module-doctrine the tests should become green again. They are currently red because codeception/module-doctrine2 is not compatible with ORMv3 and DBALv4

ThomasLandauer commented 7 months ago

OK, thanks, there you go :-)

W0rma commented 7 months ago

Great, thank you!

Tests still fail but with a different error message:

In ModuleContainer.php line 100:

  Module Doctrine2 is not installed.                   
  Use Composer to install corresponding package:       

  composer require codeception/module-doctrine2 --dev 

Sounds like this error should be fixed with https://github.com/Codeception/Codeception/pull/6741 which adjusts the module name in codeception/codeception accordingly.

Naktibalda commented 7 months ago

@W0rma that array in ModuleContainer.php is only used for printing install suggestion in error message. The problem here is that https://github.com/Codeception/symfony-module-tests still uses module-doctrine2

TavoNiievez commented 7 months ago

@Naktibalda you are right. I just corrected it in the 5.4 branch, I will do it in branches 6.4 and 7.0 before the end of the weekend.

TavoNiievez commented 7 months ago

@Naktibalda I have updated the 3 active branches of the module test project and the tests are passing there.

However, in the module CI there are errors, apparently related to PHPUnit versions.

Perhaps changes need to be made to these lines? https://github.com/Codeception/module-symfony/blob/be24b2b64759e5b4dd83ca091ecfe49c26cecc5c/.github/workflows/main.yml#L64-L66 https://github.com/Codeception/module-symfony/blob/be24b2b64759e5b4dd83ca091ecfe49c26cecc5c/.github/workflows/main.yml#L86-L88