$missing
+ */
+ public static function noticeMissing(array $missing): void
+ {
+ add_action('admin_notices', static function () use ($missing): void {
+ printf(
+ '',
+ esc_html(sprintf(
+ /* translators: %s: comma separated list of missing components */
+ __('WP-LIT-MCP ist inaktiv. Es fehlt: %s', 'wp-lit-mcp'),
+ implode(', ', $missing)
+ ))
+ );
+ });
+ }
+}
diff --git a/tests/Stubs/WpError.php b/tests/Stubs/WpError.php
new file mode 100644
index 0000000..70fd2a5
--- /dev/null
+++ b/tests/Stubs/WpError.php
@@ -0,0 +1,30 @@
+code;
+ }
+
+ public function get_error_message(): string
+ {
+ return $this->message;
+ }
+
+ public function get_error_data(): mixed
+ {
+ return $this->data;
+ }
+ }
+}
diff --git a/tests/Stubs/WpUser.php b/tests/Stubs/WpUser.php
new file mode 100644
index 0000000..bb99769
--- /dev/null
+++ b/tests/Stubs/WpUser.php
@@ -0,0 +1,17 @@
+ID = $id;
+ $this->roles = $roles;
+ }
+ }
+}
diff --git a/tests/Unit/DependenciesTest.php b/tests/Unit/DependenciesTest.php
new file mode 100644
index 0000000..f7d9de8
--- /dev/null
+++ b/tests/Unit/DependenciesTest.php
@@ -0,0 +1,27 @@
+ true);
+
+ self::assertSame([], $deps->missing());
+ }
+
+ public function testNamesEveryMissingComponent(): void
+ {
+ $deps = new Dependencies(static fn (string $class): bool => false);
+
+ self::assertSame(
+ ['wordpress/mcp-adapter', 'wp-media/mcp-oauth', 'WordPress Abilities API'],
+ $deps->missing()
+ );
+ }
+}
diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php
new file mode 100644
index 0000000..3dc5f11
--- /dev/null
+++ b/tests/Unit/TestCase.php
@@ -0,0 +1,26 @@
+'
+ . esc_html__(
+ 'WP-LIT-MCP: Abhängigkeiten fehlen. Bitte "composer install --no-dev" im Plugin-Ordner ausführen.',
+ 'wp-lit-mcp'
+ )
+ . '
';
+ });
+ return;
+}
+
+require_once $lit_mcp_autoload;
+
+add_action('plugins_loaded', static function (): void {
+ \LIT\MCP\Plugin::boot(__FILE__);
+});