feat: plugin scaffold with dependency check
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit;
|
||||
|
||||
use LIT\MCP\Dependencies;
|
||||
|
||||
final class DependenciesTest extends TestCase
|
||||
{
|
||||
public function testReportsNothingMissingWhenAllClassesExist(): void
|
||||
{
|
||||
$deps = new Dependencies(static fn (string $class): bool => 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()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit;
|
||||
|
||||
use Brain\Monkey;
|
||||
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
|
||||
use PHPUnit\Framework\TestCase as BaseTestCase;
|
||||
|
||||
abstract class TestCase extends BaseTestCase
|
||||
{
|
||||
use MockeryPHPUnitIntegration;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Monkey\setUp();
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
Monkey\tearDown();
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user