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 order tests with PHPUnit?
- How to mock an interface in PHPUnit?
- How to install PHPUnit with a PHAR file?
- How to log to the console with PHPUnit?
- How to stop PHPUnit on failure?
- How to expect an error with PHPUnit?
- How to expect an exception in PHPUnit?
- How to use the PHPUnit Framework ExceptionWrapper?
- How to increase memory limit in PHPUnit?
- How to use an inline dataprovider in PHPUnit?
See more codes...