doctrine-test-bundle | Symfony bundle to isolate your app 's doctrine | Web Framework library

 by   dmaicher PHP Version: v7.0.0 License: MIT

kandi X-RAY | doctrine-test-bundle Summary

doctrine-test-bundle is a PHP library typically used in Server, Web Framework, Symfony applications. doctrine-test-bundle has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
Symfony bundle to isolate your app's doctrine database tests and improve the test performance
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        doctrine-test-bundle has a medium active ecosystem.
                        summary
                        It has 846 star(s) with 52 fork(s). There are 8 watchers for this library.
                        summary
                        There were 1 major release(s) in the last 12 months.
                        summary
                        There are 6 open issues and 88 have been closed. On average issues are closed in 12 days. There are no pull requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of doctrine-test-bundle is v7.0.0
                        doctrine-test-bundle Support
                          Best in #Web Framework
                            Average in #Web Framework
                            doctrine-test-bundle Support
                              Best in #Web Framework
                                Average in #Web Framework

                                  kandi-Quality Quality

                                    summary
                                    doctrine-test-bundle has 0 bugs and 0 code smells.
                                    doctrine-test-bundle Quality
                                      Best in #Web Framework
                                        Average in #Web Framework
                                        doctrine-test-bundle Quality
                                          Best in #Web Framework
                                            Average in #Web Framework

                                              kandi-Security Security

                                                summary
                                                doctrine-test-bundle has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                summary
                                                doctrine-test-bundle code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                doctrine-test-bundle Security
                                                  Best in #Web Framework
                                                    Average in #Web Framework
                                                    doctrine-test-bundle Security
                                                      Best in #Web Framework
                                                        Average in #Web Framework

                                                          kandi-License License

                                                            summary
                                                            doctrine-test-bundle is licensed under the MIT License. This license is Permissive.
                                                            summary
                                                            Permissive licenses have the least restrictions, and you can use them in most projects.
                                                            doctrine-test-bundle License
                                                              Best in #Web Framework
                                                                Average in #Web Framework
                                                                doctrine-test-bundle License
                                                                  Best in #Web Framework
                                                                    Average in #Web Framework

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        doctrine-test-bundle releases are available to install and integrate.
                                                                        summary
                                                                        Installation instructions, examples and code snippets are available.
                                                                        doctrine-test-bundle Reuse
                                                                          Best in #Web Framework
                                                                            Average in #Web Framework
                                                                            doctrine-test-bundle Reuse
                                                                              Best in #Web Framework
                                                                                Average in #Web Framework
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
                                                                                  Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here
                                                                                  Get all kandi verified functions for this library.
                                                                                  Get all kandi verified functions for this library.

                                                                                  doctrine-test-bundle Key Features

                                                                                  Symfony bundle to isolate your app's doctrine database tests and improve the test performance

                                                                                  doctrine-test-bundle Examples and Code Snippets

                                                                                  No Code Snippets are available at this moment for doctrine-test-bundle.
                                                                                  Community Discussions

                                                                                  Trending Discussions on doctrine-test-bundle

                                                                                  Problems with DoctrineFixturesBundle upgrading from Symfony 5.1 to 5.2
                                                                                  chevron right
                                                                                  remove test database when tests ends (Symfony / PHP Unit)
                                                                                  chevron right
                                                                                  composer install/update trigger Class Doctrine\Common\Cache\ArrayCache does not exist
                                                                                  chevron right
                                                                                  Every modification to class causes error 'Cannot declare class because the name is already in use'
                                                                                  chevron right
                                                                                  PHP unit execute all the test
                                                                                  chevron right

                                                                                  QUESTION

                                                                                  Problems with DoctrineFixturesBundle upgrading from Symfony 5.1 to 5.2
                                                                                  Asked 2022-Feb-14 at 07:49

                                                                                  I'm upgrading my Symfony 4.4 project to Symfony 5.4 (the current LTS version). I've tried modifying composer.json, forcing directly to the 5.4 release, but I've found lots of dependency problems, so I "solved" this migrating slowly: I moved to 5.0, then to 5.1, and now I'm trying to migrate from 5.1 to 5.2, but I have dependency problems and I don't know how to fix them.

                                                                                  The problem:

                                                                                    Problem 1
                                                                                      - Conclusion: don't install doctrine/doctrine-fixtures-bundle 3.4.1 (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence[1.3.5] | install one of doctrine/persistence[1.3.7, 1.3.8, 2.2.2, 2.2.3, 2.2.4, 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence[1.3.7] | install one of doctrine/persistence[2.2.1, ..., 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.2] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.1] (conflict analysis result)
                                                                                      - Conclusion: install doctrine/common v2.11.0 (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence[1.3.8] | install one of doctrine/persistence[2.2.4, 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence[2.2.4] | install one of doctrine/common[2.13.1, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/common[2.13.3] | install doctrine/persistence[2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/common[2.13.1] | install doctrine/persistence[2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence 2.3.0 (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.4] | install one of doctrine/common[2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence[1.3.6] | install doctrine/persistence[2.2.0] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/persistence[1.2.0], doctrine/doctrine-fixtures-bundle[3.4.0] | install one of doctrine/persistence[1.3.7, 1.3.8, 2.2.0, ..., 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence 2.2.0 (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.2] | install one of doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.1] | install one of doctrine/persistence[1.3.8], doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.2.0] | install one of doctrine/persistence[1.3.8], doctrine/common[2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.1.1] | install one of doctrine/persistence[1.3.8], doctrine/common[2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/orm[2.7.5], doctrine/persistence[2.1.0] | install one of doctrine/persistence[1.1.1, 1.3.5, 1.3.7, 1.3.8], doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/orm[2.7.5] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8, 2.1.0, ..., 2.3.0], doctrine/common[2.13.0, 2.13.1, 2.13.2, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.3.0] | install one of doctrine/persistence[v1.1.0, 1.1.1, 1.2.0] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.0.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/orm[2.7.4] | install one of doctrine/persistence[v1.1.0, 1.1.1, 1.2.0, 1.3.8, 2.2.4, 2.3.0], doctrine/common[2.13.1, 2.13.3] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.1.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.0.1] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.2.2] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install one of symfony/doctrine-bridge[v5.2.10], doctrine/persistence[1.3.4] | install one of doctrine/persistence[2.1.1, ..., 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/persistence[v1.1.0], doctrine/doctrine-fixtures-bundle[3.4.0] | install one of doctrine/persistence[1.3.7, 1.3.8, 2.1.1, ..., 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence 2.1.1 (conflict analysis result)
                                                                                      - Conclusion: don't install one of symfony/doctrine-bridge[v5.2.10], doctrine/persistence[1.3.6] | install one of doctrine/persistence[2.2.2, 2.2.3, 2.2.4, 2.3.0] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[2.12.0], doctrine/persistence[2.2.4] | install one of doctrine/persistence[v1.1.0, 1.1.1, 1.2.0] (conflict analysis result)
                                                                                      - Root composer.json requires doctrine/common ^2 -> satisfiable by doctrine/common[2.1.3, ..., 2.13.3].
                                                                                      - Root composer.json requires doctrine/doctrine-fixtures-bundle ^3.4 -> satisfiable by doctrine/doctrine-fixtures-bundle[3.4.0, 3.4.1].
                                                                                      - doctrine/doctrine-fixtures-bundle 3.4.0 requires doctrine/persistence ^1.3.7|^2.0 -> satisfiable by doctrine/persistence[1.3.7, 1.3.8, 2.0.0, ..., 2.3.0].
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.1.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.0.1] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install one of doctrine/common[v2.11.0], doctrine/persistence[2.0.0] | install one of doctrine/persistence[v1.1.0, ..., 1.3.8] (conflict analysis result)
                                                                                      - Conclusion: don't install doctrine/persistence[1.1.1] | install one of doctrine/persistence[1.3.7, 2.1.1, ..., 2.2.3] (conflict analysis result)
                                                                                  

                                                                                  I suppose than the problem is with the package doctrine/doctrine-fixtures-bundle, but I'm unsure, because I find it very hard to interpret the error message. Is this the offending package? If so, is there any way to upgrade it, or should I remove it, upgrade the application and then install it again?

                                                                                  I need the package because I use it to populate the test database when running tests, but maybe there is any newer package for this job?

                                                                                  And here is my composer.json:

                                                                                  {
                                                                                      "type": "project",
                                                                                      "license": "proprietary",
                                                                                      "require": {
                                                                                          "php": "^7.1.3",
                                                                                          "ext-ctype": "*",
                                                                                          "ext-iconv": "*",
                                                                                          "a2lix/translation-form-bundle": "^3.0",
                                                                                          "composer/package-versions-deprecated": "1.11.99.4",
                                                                                          "doctrine/annotations": "^1.0",
                                                                                          "doctrine/common": "^2",
                                                                                          "doctrine/doctrine-bundle": "^2",
                                                                                          "doctrine/doctrine-migrations-bundle": "^2",
                                                                                          "doctrine/orm": "^2",
                                                                                          "friendsofsymfony/jsrouting-bundle": "^2.6",
                                                                                          "gedmo/doctrine-extensions": "^2.4",
                                                                                          "knplabs/doctrine-behaviors": "^2.0",
                                                                                          "phpdocumentor/reflection-docblock": "^5.3",
                                                                                          "phpoffice/phpspreadsheet": "^1.13",
                                                                                          "ramsey/uuid-doctrine": "^1.6",
                                                                                          "sensio/framework-extra-bundle": "^5.1",
                                                                                          "stof/doctrine-extensions-bundle": "^1.4",
                                                                                          "stripe/stripe-php": "^7.39",
                                                                                          "symfony/apache-pack": "^1.0",
                                                                                          "symfony/asset": "5.2.*",
                                                                                          "symfony/console": "5.2.*",
                                                                                          "symfony/dotenv": "5.2.*",
                                                                                          "symfony/expression-language": "5.2.*",
                                                                                          "symfony/flex": "^1.3.1",
                                                                                          "symfony/form": "5.2.*",
                                                                                          "symfony/framework-bundle": "5.2.*",
                                                                                          "symfony/http-client": "5.2.*",
                                                                                          "symfony/intl": "5.2.*",
                                                                                          "symfony/mailer": "5.2.*",
                                                                                          "symfony/monolog-bundle": "^3.5",
                                                                                          "symfony/polyfill-uuid": "^1.15",
                                                                                          "symfony/process": "5.2.*",
                                                                                          "symfony/property-access": "5.2.*",
                                                                                          "symfony/property-info": "5.2.*",
                                                                                          "symfony/security-bundle": "5.2.*",
                                                                                          "symfony/serializer": "5.2.*",
                                                                                          "symfony/translation": "5.2.*",
                                                                                          "symfony/twig-bundle": "5.2.*",
                                                                                          "symfony/validator": "5.2.*",
                                                                                          "symfony/web-link": "5.2.*",
                                                                                          "symfony/yaml": "5.2.*",
                                                                                          "twig/extra-bundle": "^2.12|^3.0",
                                                                                          "twig/twig": "^2.12|^3.0",
                                                                                          "vich/uploader-bundle": "^1.13"
                                                                                      },
                                                                                      "require-dev": {
                                                                                          "dama/doctrine-test-bundle": "^6.5",
                                                                                          "doctrine/doctrine-fixtures-bundle": "^3.4",
                                                                                          "symfony/browser-kit": "5.2.*",
                                                                                          "symfony/css-selector": "5.2.*",
                                                                                          "symfony/debug-bundle": "5.2.*",
                                                                                          "symfony/maker-bundle": "^1.15",
                                                                                          "symfony/phpunit-bridge": "^5.2",
                                                                                          "symfony/stopwatch": "5.2.*",
                                                                                          "symfony/web-profiler-bundle": "5.2.*"
                                                                                      },
                                                                                      "config": {
                                                                                          "preferred-install": {
                                                                                              "*": "dist"
                                                                                          },
                                                                                          "sort-packages": true
                                                                                      },
                                                                                      "autoload": {
                                                                                          "psr-4": {
                                                                                              "App\\": "src/"
                                                                                          }
                                                                                      },
                                                                                      "autoload-dev": {
                                                                                          "psr-4": {
                                                                                              "App\\Tests\\": "tests/"
                                                                                          }
                                                                                      },
                                                                                      "replace": {
                                                                                          "paragonie/random_compat": "2.*",
                                                                                          "symfony/polyfill-ctype": "*",
                                                                                          "symfony/polyfill-iconv": "*",
                                                                                          "symfony/polyfill-php71": "*",
                                                                                          "symfony/polyfill-php70": "*",
                                                                                          "symfony/polyfill-php56": "*"
                                                                                      },
                                                                                      "scripts": {
                                                                                          "auto-scripts": {
                                                                                              "cache:clear": "symfony-cmd",
                                                                                              "assets:install %PUBLIC_DIR%": "symfony-cmd"
                                                                                          },
                                                                                          "post-install-cmd": [
                                                                                              "@auto-scripts"
                                                                                          ],
                                                                                          "post-update-cmd": [
                                                                                              "@auto-scripts"
                                                                                          ]
                                                                                      },
                                                                                      "conflict": {
                                                                                          "symfony/symfony": "*"
                                                                                      },
                                                                                      "extra": {
                                                                                          "symfony": {
                                                                                              "allow-contrib": false,
                                                                                              "require": "5.2.*"
                                                                                          }
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  I don't know I this can be a help, but this application started as an Symfony 3.4 app, a couple years ago I upgraded to Symfony 4.4, and now I'm working in moving to 5.4...

                                                                                  ANSWER

                                                                                  Answered 2022-Feb-14 at 07:49

                                                                                  The problem is that you require doctrine/common in v2. This depends on doctrine/persistence in v1. Updating all your packages to Symfony 5.2 will also update symfony/doctrine-bridge to 5.2 - and this requires doctrine/persistence in v2.

                                                                                  Updating doctrine/common to v3 in your composer.json could help to resolve the problem. Also, since you are using symfony/flex already, you can remove all explicit version constraints on the Symfony packages - it's sufficient to define the Symfony version further down in the extra section as you already did. This makes it way easier to update all Symfony packages, as you only need to change this one line

                                                                                  Source https://stackoverflow.com/questions/71105178

                                                                                  QUESTION

                                                                                  remove test database when tests ends (Symfony / PHP Unit)
                                                                                  Asked 2021-Sep-08 at 09:14

                                                                                  I am using PHPUnit (9.5) with Symfony (5.3).

                                                                                  For my tests, I use the default test database config from config/packages/test/doctrine.yaml :

                                                                                  doctrine:
                                                                                      dbal:
                                                                                          # "TEST_TOKEN" is typically set by ParaTest
                                                                                          dbname_suffix: '_test%env(default::TEST_TOKEN)%'
                                                                                  

                                                                                  So my tests use the same database as prod with the suffix '_test'.

                                                                                  I added some code to tests/bootstrap.php to automate database creation / reset before each test runs :

                                                                                  // delete database if exists, then create
                                                                                  passthru('php bin/console doctrine:database:drop --env=test --force --if-exists');
                                                                                  passthru('php bin/console doctrine:database:create --env=test');
                                                                                  
                                                                                  // run migrations
                                                                                  passthru('php bin/console doctrine:migrations:migrate --env=test -n');
                                                                                  

                                                                                  and I use dama/doctrine-test-bundle for automatic transactions for each tests.



                                                                                  That is working very well, but I have a question :

                                                                                  Is there a way to delete the database at the end of test run ? (like I did in bootstrap.php)

                                                                                  ANSWER

                                                                                  Answered 2021-Sep-08 at 09:14

                                                                                  I understand that your bootstrap.php file is running before the test, you need a solution to launch something after your test.

                                                                                  First, create a command that drop the test database.

                                                                                  In anyway, be very careful that the code in your command stop all execution, if you aren't in an explicit test environment (because it means you are in a production environment).

                                                                                  Then, you can alter your composer.json file to launch the created command after your test in a chain of scripts.

                                                                                  Here is an exemple

                                                                                      "scripts": {
                                                                                          "test-and-remove": [
                                                                                              "@putenv APP_ENV=test",
                                                                                              "phpunit --configuration phpunit.xml",
                                                                                              "php bin/console app:drop-test-database"
                                                                                          ],
                                                                                  

                                                                                  Then you only have to launch your test via this new command:

                                                                                  composer test-and-remove
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/69084227

                                                                                  QUESTION

                                                                                  composer install/update trigger Class Doctrine\Common\Cache\ArrayCache does not exist
                                                                                  Asked 2021-Aug-04 at 15:06

                                                                                  I'm using symfony5 and wanted to deploy earlier today, which failed with the following error on vendor loading with composer install or composer update :

                                                                                  according to this issue 'Class Doctrine\Common\Cache\ArrayCache does not exist' when installing a symfony project which worked for some the error might come from my doctrine version but as i have not updated it in the past few days I do not understand how it could

                                                                                  Here is my composer.json in case:

                                                                                  {
                                                                                      "type": "project",
                                                                                      "license": "MIT",
                                                                                      "require": {
                                                                                          "php": ">=7.4",
                                                                                          "ext-ctype": "*",
                                                                                          "ext-iconv": "*",
                                                                                          "ext-json": "*",
                                                                                          "ext-zip": "*",
                                                                                          "api-platform/core": "^2.5",
                                                                                          "beberlei/doctrineextensions": "^1.3",
                                                                                          "composer/package-versions-deprecated": "^1.11",
                                                                                          "digitick/sepa-xml": "^2.1",
                                                                                          "doctrine/annotations": "^1.0",
                                                                                          "doctrine/doctrine-bundle": "^2.1",
                                                                                          "doctrine/doctrine-migrations-bundle": "^3.0",
                                                                                          "doctrine/orm": "^2.7",
                                                                                          "gesdinet/jwt-refresh-token-bundle": "^0.9.1",
                                                                                          "giggsey/libphonenumber-for-php": "^8.12",
                                                                                          "guzzlehttp/guzzle": "^7.0",
                                                                                          "h4cc/wkhtmltopdf-amd64": "^0.12.4",
                                                                                          "jsor/doctrine-postgis": "^1.7",
                                                                                          "knplabs/knp-snappy-bundle": "^1.8",
                                                                                          "lcobucci/jwt": "^3.3",
                                                                                          "lexik/jwt-authentication-bundle": "^2.8",
                                                                                          "nelmio/cors-bundle": "^2.1",
                                                                                          "phpdocumentor/reflection-docblock": "^5.2",
                                                                                          "ramsey/uuid": "^4.1",
                                                                                          "sensio/framework-extra-bundle": "^5.6",
                                                                                          "stof/doctrine-extensions-bundle": "^1.5",
                                                                                          "stripe/stripe-php": "^7.62",
                                                                                          "symfony/amqp-messenger": "5.1.*",
                                                                                          "symfony/asset": "5.1.*",
                                                                                          "symfony/console": "5.1.*",
                                                                                          "symfony/dependency-injection": "5.1.*",
                                                                                          "symfony/dotenv": "5.1.*",
                                                                                          "symfony/expression-language": "5.1.*",
                                                                                          "symfony/flex": "^1.3.1",
                                                                                          "symfony/framework-bundle": "5.1.*",
                                                                                          "symfony/http-client": "5.1.*",
                                                                                          "symfony/mailer": "5.1.*",
                                                                                          "symfony/mercure-bundle": "^0.2.5",
                                                                                          "symfony/messenger": "5.1.*",
                                                                                          "symfony/monolog-bundle": "^3.6",
                                                                                          "symfony/property-access": "5.1.*",
                                                                                          "symfony/property-info": "5.1.*",
                                                                                          "symfony/security-bundle": "5.1.*",
                                                                                          "symfony/serializer": "5.1.*",
                                                                                          "symfony/translation": "5.1.*",
                                                                                          "symfony/twig-bundle": "5.1.*",
                                                                                          "symfony/validator": "5.1.*",
                                                                                          "symfony/yaml": "5.1.*",
                                                                                          "twig/cssinliner-extra": "^3.1",
                                                                                          "twig/extra-bundle": "^2.12|^3.0",
                                                                                          "twig/inky-extra": "^3.1",
                                                                                          "twig/twig": "^2.12|^3.0",
                                                                                          "twilio/sdk": "^6.16",
                                                                                          "vich/uploader-bundle": "^1.16"
                                                                                      },
                                                                                      "require-dev": {
                                                                                          "api-platform/schema-generator": "^2.2",
                                                                                          "dama/doctrine-test-bundle": "^6.4",
                                                                                          "doctrine/doctrine-fixtures-bundle": "^3.3",
                                                                                          "fzaninotto/faker": "^1.9",
                                                                                          "justinrainbow/json-schema": "^5.2",
                                                                                          "symfony/browser-kit": "^5.1",
                                                                                          "symfony/css-selector": "^5.1",
                                                                                          "symfony/debug-bundle": "^5.1",
                                                                                          "symfony/maker-bundle": "^1.21",
                                                                                          "symfony/phpunit-bridge": "^5.1",
                                                                                          "symfony/stopwatch": "^5.1",
                                                                                          "symfony/var-dumper": "^5.1",
                                                                                          "symfony/web-profiler-bundle": "^5.1"
                                                                                      },
                                                                                      "config": {
                                                                                          "optimize-autoloader": true,
                                                                                          "preferred-install": {
                                                                                              "*": "dist"
                                                                                          },
                                                                                          "sort-packages": true
                                                                                      },
                                                                                      "autoload": {
                                                                                          "psr-4": {
                                                                                              "App\\": "src/"
                                                                                          }
                                                                                      },
                                                                                      "autoload-dev": {
                                                                                          "psr-4": {
                                                                                              "App\\Tests\\": "tests/"
                                                                                          }
                                                                                      },
                                                                                      "replace": {
                                                                                          "paragonie/random_compat": "2.*",
                                                                                          "symfony/polyfill-ctype": "*",
                                                                                          "symfony/polyfill-iconv": "*",
                                                                                          "symfony/polyfill-php74": "*",
                                                                                          "symfony/polyfill-php73": "*",
                                                                                          "symfony/polyfill-php72": "*",
                                                                                          "symfony/polyfill-php71": "*",
                                                                                          "symfony/polyfill-php70": "*",
                                                                                          "symfony/polyfill-php56": "*"
                                                                                      },
                                                                                      "scripts": {
                                                                                          "auto-scripts": {
                                                                                              "cache:clear": "symfony-cmd",
                                                                                              "assets:install %PUBLIC_DIR%": "symfony-cmd"
                                                                                          },
                                                                                          "post-install-cmd": [
                                                                                              "@auto-scripts"
                                                                                          ],
                                                                                          "post-update-cmd": [
                                                                                              "@auto-scripts"
                                                                                          ]
                                                                                      },
                                                                                      "conflict": {
                                                                                          "symfony/symfony": "*"
                                                                                      },
                                                                                      "extra": {
                                                                                          "symfony": {
                                                                                              "allow-contrib": false,
                                                                                              "require": "5.1.*"
                                                                                          }
                                                                                      }
                                                                                  }
                                                                                  
                                                                                  

                                                                                  Does anyone know where this error could come from or can think of possbile leads about possible resolution as I am stuck on this problem

                                                                                  Thank you

                                                                                  Update

                                                                                  result of composer install -v

                                                                                  ANSWER

                                                                                  Answered 2021-Aug-04 at 15:06

                                                                                  As you can read in an issue posted in the issue tracker of doctrine/cache, that class has been deprecated in v1 of that package, and removed in v2.

                                                                                  If you still want to use that class, run composer require doctrine/cache "^1.12" to install a version of that package from the v1 branch.

                                                                                  On the long run, you should check where your application requires that class and search for alternatives. If you need help with that, please share more details.

                                                                                  Source https://stackoverflow.com/questions/68652105

                                                                                  QUESTION

                                                                                  Every modification to class causes error 'Cannot declare class because the name is already in use'
                                                                                  Asked 2020-Oct-06 at 06:51

                                                                                  I've started a Symfony project for an API and have created my first controller

                                                                                  # services.yaml
                                                                                  parameters:
                                                                                  
                                                                                  services:
                                                                                      _defaults:
                                                                                          autowire: true
                                                                                          autoconfigure: true
                                                                                      App\:
                                                                                          resource: '../src/'
                                                                                          exclude:
                                                                                              - '../src/DependencyInjection/'
                                                                                              - '../src/Entity/'
                                                                                              - '../src/Kernel.php'
                                                                                              - '../src/Tests/'
                                                                                      App\Controller\:
                                                                                          resource: '../src/EndPoints/*'
                                                                                          tags: ['controller.service_arguments']
                                                                                  

                                                                                  Controller:

                                                                                  namespace App\Controller;
                                                                                  class RegisterController extends AbstractController {
                                                                                      public function register(Request $request): Response {
                                                                                           //stuff
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  I run this the first time and get an expected result. I do modifications to RegisterController and it dies with the error

                                                                                  Compile Error: Cannot declare class App\Controller\RegisterController, because the name is already in use

                                                                                  If I go into the services.yaml and save it (no modifications) I can run it again with the updated code.

                                                                                  This has only just started happening when I've added doctrine-test-bundle and been doing testing however I don't think the two things are related. I've checked my .env.local APP_ENV is dev. What is causing a cache that means I have to resave services.yaml for any change to work?

                                                                                  ANSWER

                                                                                  Answered 2020-Oct-06 at 06:38

                                                                                  From your services.yaml looks like you need to change the controller part.

                                                                                  From

                                                                                  App\Controller\:
                                                                                      resource: '../src/EndPoints/'
                                                                                      tags: ['controller.service_arguments']
                                                                                  

                                                                                  To

                                                                                  App\Controller\:
                                                                                      resource: '../src/Controller/'
                                                                                      tags: ['controller.service_arguments']
                                                                                  

                                                                                  But if you want to put controllers into the EndPoints folder, you need also change the alias in your config.

                                                                                  App\EndPoints\:
                                                                                      resource: '../src/EndPoints/*'
                                                                                      tags: ['controller.service_arguments']
                                                                                  
                                                                                  // controller
                                                                                  namespace App\EndPoints;
                                                                                  class RegisterController extends AbstractController {
                                                                                      public function register(Request $request): Response {
                                                                                           //stuff
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  And don't forget to change the routing config

                                                                                  Source https://stackoverflow.com/questions/64220247

                                                                                  QUESTION

                                                                                  PHP unit execute all the test
                                                                                  Asked 2020-Jul-31 at 13:11

                                                                                  I try running this command :

                                                                                  php bin/phpunit
                                                                                  

                                                                                  I get this error :

                                                                                  PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit\TextUI\TestRunner::doRun() in C:\wamp64\www\Test___Hanff_Web\bin.phpunit\phpunit-7.5-0\src\TextUI\Command.php:206

                                                                                  I see that it is using phpunit 7.5, but i have require phpunit 9.2 in my composer.json :

                                                                                  // composer.json
                                                                                  "require": {
                                                                                          "php": "^7.4",
                                                                                          ...
                                                                                          "phpunit/phpunit": "^9.2",       <-- here
                                                                                          "sensio/framework-extra-bundle": "^5.1",
                                                                                          "spatie/enum": "^2.3",
                                                                                          "symfony/asset": "^5.1",
                                                                                          ...
                                                                                          "symfony/framework-bundle": "5.1.*",
                                                                                          ...
                                                                                      },
                                                                                      "require-dev": {
                                                                                          "dama/doctrine-test-bundle": "^6.3",
                                                                                          "doctrine/doctrine-fixtures-bundle": "^3.3",
                                                                                          "symfony/browser-kit": "^5.1",
                                                                                          "symfony/css-selector": "^5.1",
                                                                                          "symfony/debug-pack": "^1.0",
                                                                                          "symfony/phpunit-bridge": "^5.1",   <-- Also here because symfony doc told me to import that
                                                                                          "symfony/stopwatch": "^5.1",
                                                                                          "symfony/twig-bundle": "^5.1",
                                                                                          "symfony/web-profiler-bundle": "^5.1"
                                                                                      },
                                                                                  

                                                                                  When i trying to execute this :

                                                                                  > vendor\bin\phpunit --version
                                                                                  
                                                                                  PHPUnit 9.2.6 by Sebastian Bergmann and contributors.
                                                                                  

                                                                                  I get version 9.2 instead of this :

                                                                                  > php bin/phpunit --version
                                                                                  
                                                                                  PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
                                                                                  

                                                                                  So i try to run composer update but it don't change anything. Then i try to self update phpunit as described here but nothing do !

                                                                                  I'm actually only being able to run my php test by execute this command :

                                                                                  > vendor\bin\phpunit tests/Controller/WebTest_ArticleController.php
                                                                                  

                                                                                  It execute all the tests in one TestCase file, but i can't execute all the test for all the tests/* directory.

                                                                                  I would like to be able to run all my test as :

                                                                                  > php bin/phpunit
                                                                                  
                                                                                  ... Runing all test
                                                                                  

                                                                                  Or something like :

                                                                                  > vendor\bin\phpunit tests/*
                                                                                  
                                                                                  ... Runing all test in tests/ directory
                                                                                  

                                                                                  I have also read this PHPunit Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() But it doesn't provide me any satisfying solution

                                                                                  ANSWER

                                                                                  Answered 2020-Jul-31 at 13:11

                                                                                  You have to use vendor\bin\phpunit and name your test case in tests folder something like XXXXXXXtest.php else, phpunit would not find it.

                                                                                  tests/
                                                                                     Controller/
                                                                                        ArticleController_WebTest.php
                                                                                        MenuController_WebTest.php
                                                                                        SecurityController_WebTest.php
                                                                                        ...
                                                                                     Repository/
                                                                                        ArticleRepository_KernelTest.php
                                                                                        ...
                                                                                     Services/
                                                                                        Service_UnitTest.php
                                                                                        ...
                                                                                     Utils/
                                                                                         Util_UnitTest.php
                                                                                         ...
                                                                                  

                                                                                  This is why i wasn't being able to execute all of my test just by running \vendor\bin\phpunit

                                                                                  Source https://stackoverflow.com/questions/63191118

                                                                                  Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                  Vulnerabilities

                                                                                  No vulnerabilities reported

                                                                                  Install doctrine-test-bundle

                                                                                  Enable the bundle for your test environment in your AppKernel.php. Note: if you are using symfony flex and you are allowing contrib recipes (extra.symfony.allow-contrib=true) then the bundle will be automatically enabled for the 'test' environment. See https://github.com/symfony/recipes-contrib/tree/master/dama/doctrine-test-bundle. For PHPUnit version >= 7.5 add the extension in your xml config (e.g. app/phpunit.xml). For PHPUnit version 7.0 until 7.4 add the listener in your xml config (e.g. app/phpunit.xml). Make sure you also have phpunit/phpunit available as a dev dependency (versions 7, 8 and 9 are supported with the built in listener/extension) to run your tests. Alternatively this bundle is also compatible with symfony/phpunit-bridge and its simple-phpunit script. (Note: you may need to make sure the phpunit-bridge requires the correct PHPUnit 7+ Version using the environment variable SYMFONY_PHPUNIT_VERSION).
                                                                                  install via composer composer require --dev dama/doctrine-test-bundle
                                                                                  Enable the bundle for your test environment in your AppKernel.php if (in_array($env, ['dev', 'test'])) { ... if ($env === 'test') { $bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle(); } } Note: if you are using symfony flex and you are allowing contrib recipes (extra.symfony.allow-contrib=true) then the bundle will be automatically enabled for the 'test' environment. See https://github.com/symfony/recipes-contrib/tree/master/dama/doctrine-test-bundle
                                                                                  For PHPUnit version >= 7.5 add the extension in your xml config (e.g. app/phpunit.xml) <phpunit> ... <extensions> <extension class="DAMA\DoctrineTestBundle\PHPUnit\PHPUnitExtension" /> </extensions> </phpunit> For PHPUnit version 7.0 until 7.4 add the listener in your xml config (e.g. app/phpunit.xml) <phpunit> ... <listeners> <listener class="\DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener" /> </listeners> </phpunit>
                                                                                  Make sure you also have phpunit/phpunit available as a dev dependency (versions 7, 8 and 9 are supported with the built in listener/extension) to run your tests. Alternatively this bundle is also compatible with symfony/phpunit-bridge and its simple-phpunit script. (Note: you may need to make sure the phpunit-bridge requires the correct PHPUnit 7+ Version using the environment variable SYMFONY_PHPUNIT_VERSION).
                                                                                  That's it! From now on whatever changes you do to the database within each single testcase (be it a WebTestCase or a KernelTestCase or any custom test) are automatically rolled back for you :blush:

                                                                                  Support

                                                                                  In case you are running (maybe without knowing it) queries during your tests that are implicitly committing any open transaction (see https://dev.mysql.com/doc/refman/8.0/en/implicit-commit.html for example) you might see an error like this:. Currently there is no way for this bundle to work with those queries as they simply cannot be rolled back after the test case finished.
                                                                                  Find more information at:
                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit
                                                                                  CLONE
                                                                                • HTTPS

                                                                                  https://github.com/dmaicher/doctrine-test-bundle.git

                                                                                • CLI

                                                                                  gh repo clone dmaicher/doctrine-test-bundle

                                                                                • sshUrl

                                                                                  git@github.com:dmaicher/doctrine-test-bundle.git

                                                                                • Share this Page

                                                                                  share link

                                                                                  Explore Related Topics

                                                                                  Consider Popular Web Framework Libraries

                                                                                  angular

                                                                                  by angular

                                                                                  flask

                                                                                  by pallets

                                                                                  gin

                                                                                  by gin-gonic

                                                                                  php-src

                                                                                  by php

                                                                                  symfony

                                                                                  by symfony

                                                                                  Try Top Libraries by dmaicher

                                                                                  menu-bundle

                                                                                  by dmaicherPHP

                                                                                  jquery.abbreviate

                                                                                  by dmaicherJavaScript

                                                                                  DMMenuBundle

                                                                                  by dmaicherPHP

                                                                                  rpi-quadcopter

                                                                                  by dmaicherPython

                                                                                  Compare Web Framework Libraries with Highest Support

                                                                                  angular

                                                                                  by angular

                                                                                  amphtml

                                                                                  by ampproject

                                                                                  symfony

                                                                                  by symfony

                                                                                  flask

                                                                                  by pallets

                                                                                  gin

                                                                                  by gin-gonic

                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit