function PrivateMethodUnitTestTrait::getMethod

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php \Drupal\Tests\ckeditor5\Traits\PrivateMethodUnitTestTrait::getMethod()
  2. 10 core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php \Drupal\Tests\ckeditor5\Traits\PrivateMethodUnitTestTrait::getMethod()

Gets a protected/private method to test.

Parameters

string $fqcn: A fully qualified classname.

string $name: The method name.

Return value

\ReflectionMethod The accessible method.

3 calls to PrivateMethodUnitTestTrait::getMethod()
CKEditor5Test::testPathsToFormNames in core/modules/ckeditor5/tests/src/Unit/CKEditor5Test.php
@covers \Drupal\ckeditor5\Plugin\Editor\CKEditor5::mapViolationPropertyPathsToFormNames @dataProvider providerPathsToFormNames
SmartDefaultSettingsTest::testCandidates in core/modules/ckeditor5/tests/src/Unit/SmartDefaultSettingsTest.php
@covers ::getCandidates @covers ::selectCandidate @dataProvider providerCandidates
SmartDefaultSettingsTest::testSurplusScore in core/modules/ckeditor5/tests/src/Unit/SmartDefaultSettingsTest.php
@covers ::computeSurplusScore @dataProvider providerSurplusScore

File

core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php, line 25

Class

PrivateMethodUnitTestTrait
Provides methods to test protected/private methods in unit tests.

Namespace

Drupal\Tests\ckeditor5\Traits

Code

protected static function getMethod(string $fqcn, string $name) : \ReflectionMethod {
    $class = new \ReflectionClass($fqcn);
    $method = $class->getMethod($name);
    return $method;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.