class PhpUnitBridgeRequiresTest
Test how unit tests interact with deprecation errors.
If a test requires an extension that does not exist and has a data provider the interaction between Drupal and Symfony's deprecation testing can cause errors. This test proves this is not broken.
This test will be skipped and should not cause the test suite to fail.
@group Test @requires extension will_hopefully_never_exist
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Test\PhpUnitBridgeRequiresTest implements \Drupal\Tests\UnitTestCase
Expanded class hierarchy of PhpUnitBridgeRequiresTest
See also
\Drupal\Tests\Listeners\DrupalListener
File
-
core/
tests/ Drupal/ Tests/ Core/ Test/ PhpUnitBridgeRequiresTest.php, line 21
Namespace
Drupal\Tests\Core\TestView source
class PhpUnitBridgeRequiresTest extends UnitTestCase {
/**
* Tests the @requires annotation.
*
* @dataProvider providerTestWillNeverRun
*/
public function testWillNeverRun() : void {
$deprecated = new FixtureDeprecatedClass();
$this->assertEquals('test', $deprecated->testFunction());
}
/**
* Data provider for ::testWillNeverRun().
*/
public function providerTestWillNeverRun() : array {
return [
[
'this_will_never_run',
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.