我已经使用 Symfony2 完成了我的第一个“真正的”网络应用程序。到目前为止,还没有单元测试——因为项目增长非常快——我需要在每次发布之前添加它们以检查错误。(目前我手动测试所有内容)
当我第一次使用“phpunit -c app/”时,我收到了以下弃用消息:
剩余的弃用通知 (37)
Symfony\Component\DependencyInjection\Definition::setFactoryMethod(createNamed) 自 2.6 版起已弃用,并将在 3.0 版中删除。使用 Definition::setFactory() 代替: 4x 4x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
Symfony\Component\DependencyInjection\Definition::setFactoryService(form.factory) 自 2.6 版以来已弃用,并将在 3.0 中删除。使用 Definition::setFactory() 代替: 4x 4x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Resources/config/routing/security.xml”中的“模式”选项自 2.2 版起已弃用,并将在 3.0 版中删除。改用路由定义中的“路径”选项: 3x 3x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
不推荐使用 Twig 函数“form_enctype”。在第 1 行的 FOSUserBundle:Profile:edit_content.html.twig 中使用“form_start”:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
自 1.21 版起,不推荐使用函数“vich_uploader_asset”的“Twig_Function_Method”实例。改用 Twig_SimpleFunction:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
Twig_Function 类自 1.12 版起已弃用,并将在 2.0 版中删除。改用 Twig_SimpleFunction:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/resetting”中服务“fos_user.resetting.form.handler.default”的“范围”属性.xml" 自 2.8 版以来已弃用,并将在 3.0 中删除: 1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
Twig_Function_Method 类自 1.12 版以来已弃用,并将在 2.0 中删除。改用 Twig_SimpleFunction:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
不推荐使用 Twig 函数“form_enctype”。在第 1 行的 FOSUserBundle:Group:new_content.html.twig 中使用“form_start”:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
不推荐使用 Twig 函数“form_enctype”。在第 1 行的 FOSUserBundle:Group:edit_content.html.twig 中使用“form_start”:MyNamespace\XYZBundle\Tests\Controller 的 myControllerTest::testMyAction 中的 1x 1x
不推荐使用 Twig 函数“form_enctype”。在第 1 行的 FOSUserBundle:Registration:register_content.html.twig 中使用“form_start”:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
不推荐使用 Twig 函数“form_enctype”。在第 1 行的 FOSUserBundle:ChangePassword:changePassword_content.html.twig 中使用“form_start”:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Resources/config/routing/security.xml”中路由“fos_user_security_check”的“_method”要求自2.2版起已弃用,并将在 3.0 中删除。改用“methods”属性:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
不推荐使用 Twig 函数“form_enctype”。在第 1 行的 FOSUserBundle:Resetting:reset_content.html.twig 中使用“form_start”:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/resetting.xml”中服务“fos_user.resetting.form”的“factory-service”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/change_password”中服务“fos_user.change_password.form.handler.default”的“范围”属性.xml" 自 2.8 版以来已弃用,并将在 3.0 中删除: 1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/profile.xml”中服务“fos_user.profile.form”的“工厂方法”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/profile.xml”中服务“fos_user.profile.form”的“factory-service”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
Symfony\Component\DependencyInjection\Definition::setFactoryService(doctrine) 自 2.6 版起已弃用,并将在 3.0 版中删除。使用 Definition::setFactory() 代替: 1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/orm.xml”中服务“fos_user.entity_manager”的“factory-service”属性是自 2.6 版起已弃用,并将在 3.0 版中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
Symfony\Component\DependencyInjection\Definition::setFactoryMethod(getManager) 自 2.6 版起已弃用,并将在 3.0 版中删除。使用 Definition::setFactory() 代替: 1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/profile”中服务“fos_user.profile.form.handler.default”的“范围”属性.xml" 自 2.8 版以来已弃用,并将在 3.0 中删除: 1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/registration.xml”中服务“fos_user.registration.form”的“工厂方法”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/change_password.xml”中服务“fos_user.change_password.form”的“factory-service”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/orm.xml”中服务“fos_user.entity_manager”的“工厂方法”属性是自 2.6 版起已弃用,并将在 3.0 版中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/change_password.xml”中服务“fos_user.change_password.form”的“工厂方法”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/registration”中服务“fos_user.registration.form.handler.default”的“范围”属性.xml" 自 2.8 版以来已弃用,并将在 3.0 中删除: 1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/registration.xml”中服务“fos_user.registration.form”的“factory-service”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
文件“/var/www/myproject/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/DependencyInjection/../Resources/config/resetting.xml”中服务“fos_user.resetting.form”的“工厂方法”属性" 自 2.6 版以来已弃用,并将在 3.0 中删除。改用“工厂”元素:1x 1x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests\Controller
在第一次(缓存得到构建)之后,只剩下这个:
剩余的弃用通知 (320)
“Symfony\Bundle\AsseticBundle\Config\AsseticResource”类正在通过 ResourceInterface::isFresh() 执行资源检查,自 2.8 起已弃用,并将在 3.0 中删除:320x 320x in myControllerTest::testMyAction from MyNamespace\XYZBundle\Tests \控制器
我搜索了如何抑制已弃用的警告,因为它们来自依赖项而不是来自我的代码。我找到了这个解决方案:
<php>
<ini name="error_reporting" value="-16385" />
</php>
所以我将它添加到我的 phpunit.xml 中,但它并没有解决问题。希望你能帮助我!