fix: global library edits check private and scheduled pages, name the backup on failure (P8a, P14)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -45,8 +45,8 @@ final class GlobalUsagesTest extends TestCase
|
||||
self::assertStringContainsString('LIMIT 50', $queries[1]);
|
||||
}
|
||||
|
||||
/** Ruling P8: every published page showing the entry, beyond the listing limit. */
|
||||
public function testPublishedIdsAreUnlimited(): void
|
||||
/** Ruling P8a: every live (published, private, scheduled) post showing the entry, beyond the listing limit. */
|
||||
public function testLiveIdsAreUnlimited(): void
|
||||
{
|
||||
$db = Mockery::mock(\wpdb::class)->makePartial();
|
||||
$queries = [];
|
||||
@@ -56,9 +56,9 @@ final class GlobalUsagesTest extends TestCase
|
||||
return ['1053', '1080'];
|
||||
});
|
||||
|
||||
self::assertSame([1053, 1080], (new GlobalUsages($db))->publishedIds(1059));
|
||||
self::assertSame([1053, 1080], (new GlobalUsages($db))->liveIds(1059));
|
||||
self::assertStringContainsString("LIKE '%\"globalModule\":\"1059\"%'", $queries[0]);
|
||||
self::assertStringContainsString("post_status = 'publish'", $queries[0]);
|
||||
self::assertStringContainsString("post_status IN ('publish', 'private', 'future')", $queries[0]);
|
||||
self::assertStringContainsString("post_type <> 'revision'", $queries[0]);
|
||||
self::assertStringNotContainsString('LIMIT', $queries[0]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user