代码之家  ›  专栏  ›  技术社区  ›  bux

运行测试时关闭不推荐的和严格的错误

  •  -1
  • bux  · 技术社区  · 7 年前

    我正在尝试为非常旧的PHP项目(symfony2.2.4,phpunit4.8.36)制作一个工作测试套件。

    ./phpunit -c app my/tests/path

    bindRequest() is deprecated since version 2.1 and will be removed in 2.3. Use FormInterface::bind() instead. 
    

    注意:我没有phpunit配置文件(也不知道如何创建它)。 注2:我的php.ini 已经有了 error_reporting 设置为 E_ALL & ~E_DEPRECATED & ~E_STRICT /etc/php/5.6/cli/php.ini

    1 回复  |  直到 7 年前
        1
  •  0
  •   bux    7 年前

    composer require symfony/debug
    

    把这个加进去 AppKernel#init

    if ($this->debug ) {
        Debug::enable(E_RECOVERABLE_ERROR & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED, false);
        // ...