Content test

This commit is contained in:
Oliver Davies 2024-01-04 01:35:37 +00:00
parent 9abcf39fe7
commit 07f698e6c0

View file

@ -9,6 +9,8 @@ class ExampleTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = ['node'];
public function testFrontPage(): void {
$this->drupalGet('/');
@ -36,4 +38,17 @@ class ExampleTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(Response::HTTP_OK);
}
public function testContent(): void {
$this->drupalGet('/node/1');
$this->assertSession()->statusCodeEquals(Response::HTTP_NOT_FOUND);
$this->createContentType(['type' =>'page']);
$this->createNode(['type' => 'page']);
// var_dump($this->getSession()->getPage()->getContent());
$this->drupalGet('/node/1');
$this->assertSession()->statusCodeEquals(Response::HTTP_OK);
}
}