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 skip a PHPUnit test?
- How to mock a method with different arguments in PHPUnit?
- How to ignore a test in PHPUnit?
- How to show warnings in PHPUnit?
- How to mock a static method with PHPUnit?
- How to check if a JSON contains a value in PHPUnit?
- How to test private methods in PHPUnit?
- How to stop PHPUnit on failure?
- How to generate a coverage report with PHPUnit?
- How to install PHPUnit with a PHAR file?
See more codes...