
| Current Path : /var/www/html/strat/web/core/tests/Drupal/KernelTests/Core/Batch/ |
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/strat/web/core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php |
<?php
declare(strict_types=1);
namespace Drupal\KernelTests\Core\Batch;
use Drupal\Core\Routing\RouteMatch;
use Drupal\KernelTests\KernelTestBase;
use Symfony\Component\HttpFoundation\Request;
/**
* Tests the BatchNegotiator.
*
* @group Batch
*/
class BatchNegotiatorTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
];
/**
* Test that the negotiator applies to the batch route.
*/
public function testApplies(): void {
$request = Request::create('/batch');
// Use the router to enhance the object so that a RouteMatch can be created.
$this->container->get('router')->matchRequest($request);
$routeMatch = RouteMatch::createFromRequest($request);
// The negotiator under test.
$negotiator = $this->container->get('theme.negotiator.system.batch');
$this->assertTrue($negotiator->applies($routeMatch));
}
}