php - 如何在没有交互的情况下运行doctrine 2 迁移命令行?

标签 php unit-testing zend-framework doctrine phpunit

如何在没有交互的情况下运行 Doctrine 2 迁移命令?

目前,我有以下命令在我的单元测试的设置上运行。但它总是提示用户输入“是/否”,即使我使用 --no-interaction 选项也是如此。

$input = new Symfony\Components\Console\Input\ArrayInput(
        array(
            'migrations:migrate',
            '--configuration' => APPLICATION_PATH . '/../doctrine/migrations.xml',
            '--no-interaction',
            )
        );
$cli->run($input);

最佳答案

我刚刚偶然发现了你的帖子,因为我也遇到了同样的问题。 Doctrine 迁移似乎同时更新了(我猜:https://github.com/doctrine/migrations/commit/5b2751f149bc38d38870578f753c2193eb36e742)。

因此

 php app/console --no-interaction doctrine:migrations:migrate

现在工作正常。

关于php - 如何在没有交互的情况下运行doctrine 2 迁移命令行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3448395/

相关文章:

php - 从查询生成 html 列表

php - "Can' t 在使用 mysqli_num_rows() 时在写入上下文中使用函数返回值

c# - 为什么我的 Resharper NUnit session 停止工作,但在 Debug模式下工作

php - Zend Framework 1.10.7 电话验证器

php - 如何在管理区域的类别描述后端中禁用短代码?

PHP获取div位置并存储在session中

python - 使用 Flask 和 Python 3 测试文件上传

android - Jest testing::测试失败并且错误路由到\react-native-vector-icons

php - Zend 框架中的日历

php - 有没有使用框架的大型网站?