phpunitHow to disable deprecation notices in PHPUnit?
To disable deprecation notices in PHPUnit, you can use the @group
annotation. This annotation allows you to group tests together and apply settings to the entire group. To disable deprecation notices, you can add the @group disableDeprecation
annotation to the top of your test class.
<?php
/**
* @group disableDeprecation
*/
class MyTest extends \PHPUnit_Framework_TestCase
{
// ...
}
This will disable all deprecation notices for all tests in the MyTest
class.
Code explanation
@group
annotation - This annotation allows you to group tests together and apply settings to the entire group.@group disableDeprecation
annotation - To disable deprecation notices, you can add this annotation to the top of your test class.MyTest
class - This will disable all deprecation notices for all tests in theMyTest
class.
Helpful links
More of Phpunit
- How to show warnings in PHPUnit?
- How to run all PHPUnit tests?
- How to increase memory limit in PHPUnit?
- How to assert that key exists in an array using PHPUnit?
- How to mock an interface in PHPUnit?
- How to mock a property in PHPUnit?
- How to mock with PHPUnit?
- How to use hooks in PHPUnit?
- How to run only certain methods in PHPUnit?
- How to mock a class in PHPUnit?
See more codes...