1d: Add first functional test

Ensure that anonymous users can view the site’s front page.
This commit is contained in:
Oliver Davies 2020-03-19 20:33:41 +00:00
parent 2dafec2f67
commit fd921d3e4c

View file

@ -0,0 +1,21 @@
<?php
namespace Drupal\Tests\my_module\Functional;
use Drupal\Tests\BrowserTestBase;
use Symfony\Component\HttpFoundation\Response;
class MyModuleTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = ['my_module'];
/** @test */
public function the_front_page_loads_for_anonymous_users() {
$this->drupalGet('<front>');
$this->assertResponse(Response::HTTP_OK);
}
}