*/ public array $queries = array(); public function prepare( string $sql, ...$args ): string { $i = 0; return (string) preg_replace_callback( '/%[sd]/', static function () use ( &$i, $args ) { return $args[ $i++ ] ?? '?'; }, $sql ); } public function query( string $sql ): int|bool { $this->queries[] = $sql; return 1; } public function get_var( string $sql ): ?string { return null; } public function get_col( string $sql ): array { return array(); } public function get_results( string $sql, $output = OBJECT ): array { return array(); } public function insert( string $table, array $data, $format = null ): int|false { return 1; } public function update( string $table, array $data, array $where, $format = null, $where_format = null ): int|false { return 1; } public function delete( string $table, array $where, $format = null ): int|false { return 1; } }; // Reset Feature_Flags state so is_query_active() returns false in tests. $GLOBALS['_wp_options']['wpdo_features'] = array(); } }