public function ChainRequestPolicyTest::testNullRuleChain in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php \Drupal\Tests\Core\PageCache\ChainRequestPolicyTest::testNullRuleChain()
- 9 core/tests/Drupal/Tests/Core/PageCache/ChainRequestPolicyTest.php \Drupal\Tests\Core\PageCache\ChainRequestPolicyTest::testNullRuleChain()
Asserts that check() returns NULL if a rule returns NULL.
@covers ::check
File
- core/
tests/ Drupal/ Tests/ Core/ PageCache/ ChainRequestPolicyTest.php, line 50
Class
- ChainRequestPolicyTest
- @coversDefaultClass \Drupal\Core\PageCache\ChainRequestPolicy @group PageCache
Namespace
Drupal\Tests\Core\PageCacheCode
public function testNullRuleChain() {
$rule = $this
->createMock('Drupal\\Core\\PageCache\\RequestPolicyInterface');
$rule
->expects($this
->once())
->method('check')
->with($this->request)
->will($this
->returnValue(NULL));
$this->policy
->addPolicy($rule);
$result = $this->policy
->check($this->request);
$this
->assertSame(NULL, $result);
}