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

前端 未结 3 854
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: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;
    

提交回复
热议问题