BaseRoutingTest.php in XHProf 8
File
tests/src/Kernel/BaseRoutingTest.php
View source
<?php
namespace Drupal\Tests\xhprof\Kernel;
use Drupal\Core\Url;
use Drupal\KernelTests\KernelTestBase;
class BaseRoutingTest extends KernelTestBase {
protected static $modules = [
'xhprof',
];
public function testSymbolRoute($symbol, $expected) {
$run = 1;
$url = Url::fromRoute('xhprof.symbol', [
'run' => $run,
'symbol' => $symbol,
]);
$this
->assertSame('/admin/reports/xhprof/' . $run . '/symbol/' . $expected, $url
->toString());
}
public function dataSymbols() {
return [
'backslash' => [
'Drupal\\xhprof\\EventSubscriber\\XHProfEventSubscriber::onKernelTerminate',
'Drupal%5Cxhprof%5CEventSubscriber%5CXHProfEventSubscriber%3A%3AonKernelTerminate',
],
'slash' => [
'load::Controller/NodeController.php',
'load%3A%3AController/NodeController.php',
],
];
}
}