Symfony 3.4 - “no commands defined in the “doctrine:schema” namespace” when attempting to run console command in class

前端 未结 3 855
Happy的楠姐
Happy的楠姐 2021-01-25 03:56

I\'m following along with this blog to create unit tests that use my data fixtures as a base. The relevant code:

namespace Tests\\AppBundle\\Repository;

use Sy         


        
相关标签:
3条回答
  • 2021-01-25 04:28

    As suggested by Denis, try adding Doctrine bundles via componser:

    composer require doctrine/doctrine-bundle
    composer require doctrine/doctrine-fixtures-bundle --dev
    
    0 讨论(0)
  • 2021-01-25 04:30

    doctrine/doctrine-bundle and doctrine/doctrine-fixtures-bundle should be installed to run doctrine:schema and doctrine:fixtures commands

    0 讨论(0)
  • 2021-01-25 04:44

    Your problem is that you are using the wrong Application class for this.

    Have a look at your bin/console php file. github link

    Change:

    use Symfony\Component\Console\Application;
    

    to

    use Symfony\Bundle\FrameworkBundle\Console\Application;
    
    0 讨论(0)
提交回复
热议问题