feat(pods): Verhaltensprobe als Prüfschritt

Beim Prüfen schreibt und liest PodsProbe auf einem Wegwerf-Entwurf ein Textfeld genau so, wie LIT MCP es tut, vergleicht die Werte und löscht den Entwurf wieder. Bevorzugt von Pods angelegte Typen; ohne Pod mit Textfeld gilt der Schritt als grün mit Hinweis „nicht geprüft“. Ein roter Schritt sperrt Pods über die Berichtssperre. Liegengebliebene Probe-Einträge räumt der Load-Hook des Reiters auf. Pods-Smoke um Probe und Bereinigung erweitert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-11-06 14:33:26 +01:00
co-authored by Claude Opus 5.5
parent 42aa4f8dc9
commit 1a294b7881
11 changed files with 812 additions and 10 deletions
+46
View File
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace LIT\MCP\Tests\Unit\Integrations\Pods;
use Brain\Monkey\Functions;
use LIT\MCP\Admin\CompatibilityTab;
use LIT\MCP\Compatibility\ProvidesCompatibility;
use LIT\MCP\Guides\InstructionsBuilder;
use LIT\MCP\Integrations\Integration;
@@ -26,6 +28,50 @@ final class PodsIntegrationTest extends TestCase
self::assertEquals([PodsCompatibility::profile()], $integration->compatibilities());
}
public function testBootHooksTheOrphanCleanupIntoTheProfileLoad(): void
{
$integration = new PodsIntegration();
$integration->boot();
self::assertNotFalse(has_action(CompatibilityTab::LOAD_ACTION, [$integration, 'removeOrphans']));
}
public function testNoCleanupForAnotherProfile(): void
{
Functions\expect('get_posts')->never();
Functions\when('current_user_can')->justReturn(true);
(new PodsIntegration(static fn (): bool => true))->removeOrphans('divi');
$this->addToAssertionCount(1);
}
public function testNoCleanupWithoutPods(): void
{
Functions\expect('get_posts')->never();
Functions\when('current_user_can')->justReturn(true);
(new PodsIntegration(static fn (): bool => false))->removeOrphans('pods');
$this->addToAssertionCount(1);
}
public function testNoCleanupWithoutTheCapability(): void
{
Functions\expect('get_posts')->never();
Functions\when('current_user_can')->justReturn(false);
(new PodsIntegration(static fn (): bool => true))->removeOrphans('pods');
$this->addToAssertionCount(1);
}
public function testCleansUpForTheAdministratorWithPods(): void
{
Functions\when('current_user_can')->justReturn(true);
Functions\when('get_post_types')->justReturn(['post' => 'post']);
Functions\expect('get_posts')->once()->andReturn([]);
(new PodsIntegration(static fn (): bool => true))->removeOrphans('pods');
}
public function testIsAvailableOnlyWithPods(): void
{
self::assertSame(defined('PODS_VERSION'), (new PodsIntegration())->isAvailable());