refactor: Kern ohne Divi – Ports BuilderDetector, MediaUsageSource, EnvironmentComponent und ausgeschlossene Post-Typen im ContentSchema; Divi-Implementierungen und Verdrahtung über DiviIntegration/Plugin; CoreIndependenceTest
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
abeb4b0eed
commit
06148fb8c1
@@ -8,6 +8,7 @@ use Brain\Monkey\Functions;
|
||||
use LIT\MCP\Abilities\Cursor;
|
||||
use LIT\MCP\Integrations\WordPress\Content\PostPresenter;
|
||||
use LIT\MCP\Integrations\WordPress\Revisions\RevisionsListAbility;
|
||||
use LIT\MCP\Tests\Support\FakeBuilderDetector;
|
||||
use LIT\MCP\Tests\Support\SchemaFixture;
|
||||
use LIT\MCP\Tests\Unit\TestCase;
|
||||
use WP_Post;
|
||||
@@ -24,11 +25,11 @@ final class RevisionsListAbilityTest extends TestCase
|
||||
Functions\when('get_post_meta')->justReturn('');
|
||||
}
|
||||
|
||||
private function ability(): RevisionsListAbility
|
||||
private function ability(?PostPresenter $presenter = null): RevisionsListAbility
|
||||
{
|
||||
$schema = SchemaFixture::managed();
|
||||
|
||||
return new RevisionsListAbility($schema);
|
||||
return new RevisionsListAbility($schema, $presenter);
|
||||
}
|
||||
|
||||
public function testListsRevisionsNewestFirstWithCursor(): void
|
||||
@@ -60,11 +61,14 @@ final class RevisionsListAbilityTest extends TestCase
|
||||
811 => new WP_Post(['ID' => 811, 'post_content' => '<p>Normal</p>']),
|
||||
]);
|
||||
|
||||
$result = $this->ability()->execute(['post_id' => 5]);
|
||||
$presenter = new PostPresenter(SchemaFixture::managed(), new FakeBuilderDetector(true));
|
||||
|
||||
$result = $this->ability($presenter)->execute(['post_id' => 5]);
|
||||
|
||||
self::assertTrue($result['items'][0]['divi']);
|
||||
self::assertFalse($result['items'][1]['divi']);
|
||||
self::assertSame([PostPresenter::diviHint()], $result['hints']);
|
||||
self::assertSame([$presenter->diviHint()], $result['hints']);
|
||||
self::assertStringContainsString(PostPresenter::DIVI_NOTE, $result['hints'][0]);
|
||||
}
|
||||
|
||||
public function testRevisionsOfATrashedPostCanStillBeListed(): void
|
||||
|
||||
Reference in New Issue
Block a user