
| Current Path : /var/www/html/rocksensor1/web/core/tests/Drupal/Tests/Core/Routing/ |
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/rocksensor1/web/core/tests/Drupal/Tests/Core/Routing/PathChangedHelperTest.php |
<?php
declare(strict_types=1);
namespace Drupal\Tests\Core\Routing;
use Drupal\Core\Routing\PathChangedHelper;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\HttpFoundation\Request;
/**
* @coversDefaultClass \Drupal\Core\Routing\PathChangedHelper
* @group Routing
*/
class PathChangedHelperTest extends UnitTestCase {
/**
* Tests that the constructor validates its arguments.
*
* @covers ::__construct
*/
public function testPathChangedHelperException(): void {
$route_match = $this->prophesize(RouteMatchInterface::class);
$route_match->getRouteName()->willReturn('path.changed.not-bc');
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Drupal\Core\Routing\PathChangedHelper expects a route name that ends with ".bc".');
new PathChangedHelper($route_match->reveal(), new Request());
}
}