BigPipeSessionlessRegressionTest.php in Sessionless BigPipe 2.x
File
tests/src/Functional/BigPipeSessionlessRegressionTest.php
View source
<?php
namespace Drupal\Tests\big_pipe_sessionless\Functional;
use Drupal\Core\Cache\Cache;
use Drupal\Tests\BrowserTestBase;
class BigPipeSessionlessRegressionTest extends BrowserTestBase {
protected $defaultTheme = 'classy';
public static $modules = [
'big_pipe',
'big_pipe_sessionless',
];
public function testHeadRequestForIssue2942484() {
$client = $this
->getSession()
->getDriver()
->getClient()
->getClient();
Cache::invalidateTags([
'rendered',
]);
$response = $client
->request('HEAD', $this
->getAbsoluteUrl('/'));
$this
->assertSame(200, $response
->getStatusCode());
$this
->assertFalse($response
->hasHeader('Surrogate-Control'));
$this
->assertFalse($response
->hasHeader('X-Accel-Buffering'));
$this
->assertSame([
'MISS',
], $response
->getHeader('X-Drupal-Cache'));
$this
->assertSame([
'MISS',
], $response
->getHeader('X-Drupal-Dynamic-Cache'));
}
}