Ensure it returns a 200 response
This commit is contained in:
parent
5036f657b3
commit
fa691746f0
|
@ -0,0 +1,3 @@
|
||||||
|
name: Talks
|
||||||
|
type: module
|
||||||
|
core_version_requirement: ^10
|
|
@ -0,0 +1,6 @@
|
||||||
|
opdavies_talks.page:
|
||||||
|
path: /talks
|
||||||
|
defaults:
|
||||||
|
_controller: Drupal\opdavies_talks\Controller\TalksPageController
|
||||||
|
requirements:
|
||||||
|
_permission: access content
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Drupal\opdavies_talks\Controller;
|
||||||
|
|
||||||
|
final class TalksPageController {
|
||||||
|
|
||||||
|
public function __invoke(): array {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Drupal\Tests\opdavies_talks\Functional;
|
||||||
|
|
||||||
|
use Drupal\Tests\BrowserTestBase;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
|
class TalksPageTest extends BrowserTestBase {
|
||||||
|
|
||||||
|
public $defaultTheme = 'stark';
|
||||||
|
|
||||||
|
public static $modules = ['node', 'opdavies_talks'];
|
||||||
|
|
||||||
|
public function test_it_returns_a_200_response_code(): void {
|
||||||
|
$this->drupalGet('/talks');
|
||||||
|
|
||||||
|
$session = $this->assertSession();
|
||||||
|
$session->statusCodeEquals(Response::HTTP_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue