3a: Add blog page functional test
Add the new `BlogPageTest` functional test to ensure that anonymous users can access the `/blog` page. This fails, and returns a 404 response code rather than the expected 200 response code.
This commit is contained in:
parent
9df597c965
commit
151803382e
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Drupal\my_module\Functional;
|
||||||
|
|
||||||
|
use Drupal\Tests\BrowserTestBase;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class BlogPageTest extends BrowserTestBase {
|
||||||
|
|
||||||
|
protected $defaultTheme = 'stark';
|
||||||
|
|
||||||
|
protected static $modules = [
|
||||||
|
'my_module',
|
||||||
|
];
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function the_blog_page_loads_for_anonymous_users_and_contains_the_right_text() {
|
||||||
|
$this->drupalGet('blog');
|
||||||
|
|
||||||
|
$session = $this->assertSession();
|
||||||
|
|
||||||
|
$session->statusCodeEquals(Response::HTTP_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue