'
A
', 'post_title' => 'T', 'post_excerpt' => 'E', 'post_status' => 'draft', 'post_modified_gmt' => '2026-09-25 08:00:00', ]; $rev = Rev::ofPost(new WP_Post($base)); self::assertMatchesRegularExpression('/^[0-9a-f]{12}$/', $rev); self::assertSame($rev, Rev::ofPost(new WP_Post($base))); self::assertNotSame(Rev::of('A
'), $rev); foreach (['post_content' => 'B
', 'post_title' => 'U', 'post_excerpt' => 'F', 'post_status' => 'publish', 'post_modified_gmt' => '2026-09-25 08:00:01'] as $key => $value) { self::assertNotSame($rev, Rev::ofPost(new WP_Post(array_merge($base, [$key => $value]))), $key); } } public function testMatchesComparesInputRevWithThePostRev(): void { $post = new WP_Post(['post_title' => 'T']); self::assertTrue(Rev::matches(['rev' => Rev::ofPost($post)], $post)); self::assertFalse(Rev::matches(['rev' => 'abcdefabcdef'], $post)); self::assertFalse(Rev::matches([], $post)); self::assertFalse(Rev::matches(['rev' => 123], $post)); } public function testEmptyMapBecomesJsonObject(): void { self::assertInstanceOf(stdClass::class, JsonMap::of([])); self::assertSame('{}', json_encode(JsonMap::of([]))); self::assertSame(['a' => 1], JsonMap::of(['a' => 1])); } }