
| Current Path : /var/www/html/store/web/core/modules/ckeditor5/tests/src/Traits/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php |
<?php
namespace Drupal\Tests\ckeditor5\Traits;
/**
* Provides methods to test protected/private methods in unit tests.
*
* @internal
*/
trait PrivateMethodUnitTestTrait {
/**
* Gets a protected/private method to test.
*
* @param string $fqcn
* A fully qualified classname.
* @param string $name
* The method name.
*
* @return \ReflectionMethod
* The accessible method.
*/
protected static function getMethod(string $fqcn, string $name): \ReflectionMethod {
$class = new \ReflectionClass($fqcn);
$method = $class->getMethod($name);
$method->setAccessible(TRUE);
return $method;
}
}