Initial Drupal 11 with DDEV setup
This commit is contained in:
44
vendor/chi-teck/drupal-code-generator/templates/Test/_browser/browser.twig
vendored
Normal file
44
vendor/chi-teck/drupal-code-generator/templates/Test/_browser/browser.twig
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\Tests\{{ machine_name }}\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* Test description.
|
||||
*/
|
||||
#[Group('{{ machine_name }}')]
|
||||
final class {{ class }} extends BrowserTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'claro';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected static $modules = ['{{ machine_name }}'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
// Set up the test here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Test callback.
|
||||
*/
|
||||
public function testSomething(): void {
|
||||
$admin_user = $this->drupalCreateUser(['administer site configuration']);
|
||||
$this->drupalLogin($admin_user);
|
||||
$this->drupalGet('/admin/config/system/site-information');
|
||||
$this->assertSession()->elementExists('xpath', '//h1[text() = "Basic site settings"]');
|
||||
}
|
||||
|
||||
}
|
||||
36
vendor/chi-teck/drupal-code-generator/templates/Test/_kernel/kernel.twig
vendored
Normal file
36
vendor/chi-teck/drupal-code-generator/templates/Test/_kernel/kernel.twig
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\Tests\{{ machine_name }}\Kernel;
|
||||
|
||||
use Drupal\KernelTests\KernelTestBase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* Test description.
|
||||
*/
|
||||
#[Group('{{ machine_name }}')]
|
||||
final class {{ class }} extends KernelTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected static $modules = ['{{ machine_name }}'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
// Mock necessary services here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Test callback.
|
||||
*/
|
||||
public function testSomething(): void {
|
||||
self::assertTrue(TRUE);
|
||||
}
|
||||
|
||||
}
|
||||
16
vendor/chi-teck/drupal-code-generator/templates/Test/_nightwatch/nightwatch.twig
vendored
Normal file
16
vendor/chi-teck/drupal-code-generator/templates/Test/_nightwatch/nightwatch.twig
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
'@tags': ['{{ machine_name }}'],
|
||||
before(browser) {
|
||||
browser.drupalInstall();
|
||||
},
|
||||
after(browser) {
|
||||
browser.drupalUninstall();
|
||||
},
|
||||
'Front page': browser => {
|
||||
browser
|
||||
.drupalRelativeURL('/')
|
||||
.waitForElementVisible('body', 1000)
|
||||
.assert.containsText('h1', 'Log in')
|
||||
.drupalLogAndEnd({onlyOnError: false});
|
||||
},
|
||||
};
|
||||
31
vendor/chi-teck/drupal-code-generator/templates/Test/_unit/unit.twig
vendored
Normal file
31
vendor/chi-teck/drupal-code-generator/templates/Test/_unit/unit.twig
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\Tests\{{ machine_name }}\Unit;
|
||||
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* Test description.
|
||||
*/
|
||||
#[Group('{{ machine_name }}')]
|
||||
final class {{ class }} extends UnitTestCase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
// @todo Mock required classes here.
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests something.
|
||||
*/
|
||||
public function testSomething(): void {
|
||||
self::assertTrue(TRUE, 'This is TRUE!');
|
||||
}
|
||||
|
||||
}
|
||||
41
vendor/chi-teck/drupal-code-generator/templates/Test/_webdriver/webdriver.twig
vendored
Normal file
41
vendor/chi-teck/drupal-code-generator/templates/Test/_webdriver/webdriver.twig
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Drupal\Tests\{{ machine_name }}\FunctionalJavascript;
|
||||
|
||||
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
/**
|
||||
* Tests the JavaScript functionality of the {{ name }} module.
|
||||
*/
|
||||
#[Group('{{ machine_name }}')]
|
||||
final class {{ class }} extends WebDriverTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $defaultTheme = 'claro';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected static $modules = ['{{ machine_name }}'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
// @todo Set up the test here or remove this method.
|
||||
}
|
||||
|
||||
/**
|
||||
* Test callback.
|
||||
*/
|
||||
public function testSomething(): void {
|
||||
// Place your code here.
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user