feat: add an example module with custom tests
Add a custom module based on my Drupal module template: https://github.com/opdavies/drupal-module-template
This commit is contained in:
parent
ea60b27438
commit
67a9f556c4
10 changed files with 117 additions and 0 deletions
web/modules/custom/example/tests/src
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\example\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ExamplePageTest extends BrowserTestBase {
|
||||
|
||||
public $defaultTheme = 'stark';
|
||||
|
||||
protected static $modules = [
|
||||
// Core.
|
||||
'node',
|
||||
|
||||
// Custom.
|
||||
"example"
|
||||
];
|
||||
|
||||
/** @test */
|
||||
public function should_load_the_example_page_for_anonymous_users(): void {
|
||||
// Arrange.
|
||||
|
||||
// Act.
|
||||
$this->drupalGet('/@opdavies/drupal-module-template');
|
||||
|
||||
// Assert.
|
||||
$this->assertSession()->statusCodeEquals(Response::HTTP_OK);
|
||||
}
|
||||
|
||||
}
|
0
web/modules/custom/example/tests/src/Kernel/.keep
Normal file
0
web/modules/custom/example/tests/src/Kernel/.keep
Normal file
0
web/modules/custom/example/tests/src/Unit/.keep
Normal file
0
web/modules/custom/example/tests/src/Unit/.keep
Normal file
Loading…
Add table
Add a link
Reference in a new issue