Test Drupal pages
This commit is contained in:
parent
11391c2b86
commit
44adee585b
|
@ -3,13 +3,24 @@
|
|||
namespace Drupal\Tests\example\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class ExampleTest extends BrowserTestBase {
|
||||
|
||||
protected $defaultTheme = 'stark';
|
||||
|
||||
public function testBasic(): void {
|
||||
self::assertTrue(TRUE);
|
||||
public function testFrontPage(): void {
|
||||
$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