first commit

This commit is contained in:
2024-07-15 12:33:27 +02:00
commit ce50ae282b
22084 changed files with 2623791 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\{{ machine_name }}\Functional;
use Drupal\Tests\BrowserTestBase;
/**
* 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"]');
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\{{ machine_name }}\Kernel;
use Drupal\KernelTests\KernelTestBase;
/**
* 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);
}
}

View 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});
},
};

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\{{ machine_name }}\Unit;
use Drupal\Tests\UnitTestCase;
/**
* 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!');
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace Drupal\Tests\{{ machine_name }}\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
/**
* 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.
}
}