function PrivateMethodUnitTestTrait::getMethod

Same name and namespace in other branches
  1. 9 core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php \Drupal\Tests\ckeditor5\Traits\PrivateMethodUnitTestTrait::getMethod()
  2. 11.x 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[[api-linebreak]] @dataProvider providerPathsToFormNames
SmartDefaultSettingsTest::testCandidates in core/modules/ckeditor5/tests/src/Unit/SmartDefaultSettingsTest.php
@covers ::getCandidates[[api-linebreak]] @covers ::selectCandidate[[api-linebreak]] @dataProvider providerCandidates
SmartDefaultSettingsTest::testSurplusScore in core/modules/ckeditor5/tests/src/Unit/SmartDefaultSettingsTest.php
@covers ::computeSurplusScore[[api-linebreak]] @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.