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
@groupannotation - This annotation allows you to group tests together and apply settings to the entire group.@group disableDeprecationannotation - To disable deprecation notices, you can add this annotation to the top of your test class.MyTestclass - This will disable all deprecation notices for all tests in theMyTestclass.
Helpful links
More of Phpunit
- How to show warnings in PHPUnit?
- How to stop PHPUnit on failure?
- How to run tests in parallel with PHPUnit?
- How to skip a PHPUnit test?
- What are PHPUnit required extensions
- How to mock a query builder with PHPUnit?
- How to install PHPUnit from Packagist?
- How to order tests with PHPUnit?
- How to log with PHPUnit?
- How to use the PHPUnit cache?
See more codes...