从Symfony 2测试用例运行控制台命令 [英] Running console command from a Symfony 2 test case

查看:88
本文介绍了从Symfony 2测试用例运行控制台命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过Symfony 2测试用例运行控制台命令?我想运行用于创建和删除架构的主义命令.

Is there a way to run a console command from a Symfony 2 test case? I want to run the doctrine commands for creating and dropping schemas.

推荐答案

自上次回答以来,文档已更新,以反映调用现有命令的Symfony 2正确方法:

The documentation has been updated since my last answer to reflect the proper Symfony 2 way of calling an existing command:

http://symfony.com/doc/current/components/console/introduction.html#calling-an-existing-command

这篇关于从Symfony 2测试用例运行控制台命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆