samedi 30 septembre 2017

codeception : Setting the "doctrine" pre-defined service is deprecated since Symfony 3.3 and won't be supported anymore in Symfony 4.0

My project is a Symfony 3.3.9 project with Doctrine ORM. I use codeception 2.3.6 with the module Doctrine2, I follow this article : http://ift.tt/1EuuTA1

My config of codeception is :

#tests/functional.suite.yml
actor: FunctionalTester
modules:
    enabled:
        - \Helper\Functional
        - PhpBrowser:
            url: http://localhost 
        - Symfony 
        - Doctrine2:
            depends: Symfony
            cleanup: true

When I run the suite of tests with this command

./vendor/bin/codecept run functional

The tests pass very well with Success, but deprecated messages are thrown :

Setting the "doctrine" pre-defined service is deprecated since Symfony 3.3 and won't be supported anymore in Symfony 4.0

When I remove the configuration of Doctrine2 module from functional.suite.yml

#tests/functional.suite.yml
actor: FunctionalTester
modules:
    enabled:
        - \Helper\Functional
        - PhpBrowser:
            url: http://localhost 
        - Symfony 

I have to remove the calls of $I->grabEntityFromRepository() in my tests classes, and the deprecated disappear

Aucun commentaire:

Enregistrer un commentaire