gutenberg_ai_tools-1.0.x-dev/tests/src/Functional/GutenbergAiToolsAdminTest.php
tests/src/Functional/GutenbergAiToolsAdminTest.php
<?php
namespace Drupal\Tests\gutenberg_ai_tools\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* Tests the Gutenberg AI Tools Admin Page and the Home Page.
*
* @group gutenberg_ai_tools
*/
class GutenbergAiToolsAdminTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array<string>
*/
protected static $modules = ['gutenberg'];
/**
* Theme to enable.
*
* @var string
*/
protected $defaultTheme = 'claro';
/**
* Disable strict config schema.
*
* @var bool
*/
protected $strictConfigSchema = FALSE;
/**
* {@inheritdoc}
*/
protected function setUp(): void {
// Make sure to complete the normal setup steps first.
parent::setUp();
// Log in an administrative user.
$this->drupalLogin($this->rootUser);
}
/**
* Tests if user can load the front page among other things.
*/
public function testLoadSite() {
// Load the front page.
$this->drupalGet('<front>');
// Confirm that the site didn't throw a server error or something else.
$this->assertSession()->statusCodeEquals(200);
}
/**
* Tests the admin page.
*/
public function testAdminPage() {
$this->drupalGet('admin/config/');
$session = $this->assertSession();
$session->statusCodeEquals(200);
}
}
