class BatchNegotiatorTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php \Drupal\KernelTests\Core\Batch\BatchNegotiatorTest
- 10 core/tests/Drupal/KernelTests/Core/Batch/BatchNegotiatorTest.php \Drupal\KernelTests\Core\Batch\BatchNegotiatorTest
Tests the BatchNegotiator.
@group Batch
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Batch\BatchNegotiatorTest implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of BatchNegotiatorTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Batch/ BatchNegotiatorTest.php, line 16
Namespace
Drupal\KernelTests\Core\BatchView source
class BatchNegotiatorTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'system',
];
/**
* Test that the negotiator applies to the batch route.
*/
public function testApplies() {
$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));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.