Same filename and directory in other branches
- 8.9.x core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php
- 9 core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php
Namespace
Drupal\Tests\taxonomy\Functional
File
core/modules/taxonomy/tests/src/Functional/VocabularySerializationTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\taxonomy\Functional;
use Drupal\taxonomy\Entity\Vocabulary;
use Drupal\Tests\BrowserTestBase;
class VocabularySerializationTest extends BrowserTestBase {
protected static $modules = [
'taxonomy',
'vocabulary_serialization_test',
];
protected $defaultTheme = 'stark';
protected function setUp() : void {
parent::setUp();
Vocabulary::create([
'vid' => 'test',
'name' => 'Test',
])
->save();
}
public function testSerialization() {
$this
->drupalGet('/vocabulary_serialization_test/test');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSame('this is the output', $this
->getSession()
->getPage()
->getContent());
$this
->assertSession()
->responseHeaderEquals('X-Drupal-Cache', 'MISS');
$this
->drupalGet('/vocabulary_serialization_test/test');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSame('this is the output', $this
->getSession()
->getPage()
->getContent());
$this
->assertSession()
->responseHeaderEquals('X-Drupal-Cache', 'HIT');
}
}
Classes