fix: trashed backup before replace, byte-exact meta copy, partial rollback

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:
2026-09-25 23:34:13 +02:00
co-authored by Claude Opus 5.5
parent 4fed69cf65
commit e183874ff7
7 changed files with 490 additions and 152 deletions
@@ -68,6 +68,17 @@ final class PostDuplicateAbilityTest extends TestCase
self::assertSame('lit_forbidden', $result->get_error_code());
}
public function testATrashedOriginalIsRefused(): void
{
$this->original->post_status = 'trash';
$cloner = Mockery::mock(PostCloner::class);
$cloner->expects('duplicate')->never();
$result = $this->ability($cloner, Mockery::mock(ChangeLog::class))->execute(['post_id' => 5]);
self::assertSame('lit_validation_failed', $result->get_error_code());
}
public function testIsIndirectAndNotIdempotent(): void
{
$ability = $this->ability(Mockery::mock(PostCloner::class), Mockery::mock(ChangeLog::class));