test: add FrontPageTest
This commit is contained in:
parent
4e0615281c
commit
c78f3d0435
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Drupal\Tests\example\Functional;
|
||||||
|
|
||||||
|
use Drupal\Tests\BrowserTestBase;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
final class FrontPageTest extends BrowserTestBase {
|
||||||
|
|
||||||
|
public $defaultTheme = 'stark';
|
||||||
|
|
||||||
|
protected static $modules = ['node', 'views'];
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function the_front_page_loads_for_anonymous_users(): void {
|
||||||
|
$this->config('system.site')
|
||||||
|
->set('page.front', '/node')
|
||||||
|
->save(TRUE);
|
||||||
|
|
||||||
|
$this->drupalGet('<front>');
|
||||||
|
|
||||||
|
$assert = $this->assertSession();
|
||||||
|
|
||||||
|
$assert->statusCodeEquals(Response::HTTP_OK);
|
||||||
|
$assert->pageTextContains('No front page content has been created yet.');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in a new issue