From 61f2761bb6e6b9b2ff655d4078cc41aa8042f04b Mon Sep 17 00:00:00 2001 From: Joe Corall Date: Sun, 17 Nov 2024 15:29:44 -0500 Subject: [PATCH] Add a basic test --- composer.json | 20 ++++++++++++++ tests/src/Kernel/TurnstileProtect.php | 38 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 composer.json create mode 100644 tests/src/Kernel/TurnstileProtect.php diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..374c1c4 --- /dev/null +++ b/composer.json @@ -0,0 +1,20 @@ +{ + "name": "drupal/turnstile_protect", + "description": "Put your site routes behind a Cloudflare Turnstile", + "type": "drupal-module", + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/turnstile_protect", + "support": { + "issues": "https://www.drupal.org/project/issues/turnstile_protect" + }, + "authors": [ + { + "name": "Joe Corall", + "email": "jjc223@lehigh.edu", + "role": "Owner" + } + ], + "require" : { + "drupal/turnstile": "^1" + } +} \ No newline at end of file diff --git a/tests/src/Kernel/TurnstileProtect.php b/tests/src/Kernel/TurnstileProtect.php new file mode 100644 index 0000000..45ee2e6 --- /dev/null +++ b/tests/src/Kernel/TurnstileProtect.php @@ -0,0 +1,38 @@ +assertTrue($this->container->get('module_handler')->moduleExists('turnstile_protect'), 'The turnstile_protect module is enabled.'); + } + + /** + * Tests basic configuration or service. + */ + public function testBasicFunctionality() { + // Example: Check a service or configuration provided by your module. + $config = $this->config('turnstile_protect.settings'); + $this->assertNotEmpty($config, 'turnstile_protect settings configuration is available.'); + } + +}