allows('esc_like')->andReturnUsing(static fn (string $text): string => $text); $db->expects('prepare') ->with( '(LOWER(post_content) LIKE %s OR LOWER(post_content) LIKE %s OR post_content REGEXP %s)', '%globalmodule%', '%global_module%', '\\\\u00[4-7][0-9a-fA-F]' ) ->andReturn('(prepared)'); self::assertSame('(prepared)', (new LibraryUsageQuery(12))->candidateCondition($db)); } public function testMatchesThroughTheUsageMatcher(): void { $query = new LibraryUsageQuery(12); self::assertTrue($query->matches('')); self::assertFalse($query->matches('')); } }