Test Drupal pages
This commit is contained in:
parent
11391c2b86
commit
44adee585b
|
@ -3,13 +3,24 @@
|
||||||
namespace Drupal\Tests\example\Functional;
|
namespace Drupal\Tests\example\Functional;
|
||||||
|
|
||||||
use Drupal\Tests\BrowserTestBase;
|
use Drupal\Tests\BrowserTestBase;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class ExampleTest extends BrowserTestBase {
|
class ExampleTest extends BrowserTestBase {
|
||||||
|
|
||||||
protected $defaultTheme = 'stark';
|
protected $defaultTheme = 'stark';
|
||||||
|
|
||||||
public function testBasic(): void {
|
public function testFrontPage(): void {
|
||||||
self::assertTrue(TRUE);
|
$this->drupalGet('/');
|
||||||
|
|
||||||
|
$assert = $this->assertSession();
|
||||||
|
$assert->statusCodeEquals(Response::HTTP_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAdminPage(): void {
|
||||||
|
$this->drupalGet('/admin');
|
||||||
|
|
||||||
|
$assert = $this->assertSession();
|
||||||
|
$assert->statusCodeEquals(Response::HTTP_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue