Skip to content

Instantly share code, notes, and snippets.

Created August 21, 2009 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/172164 to your computer and use it in GitHub Desktop.
Save anonymous/172164 to your computer and use it in GitHub Desktop.
#----------------------------------------------------------------------------
# Test that HTML entities are decoded.
$article->update({
description => "schön & cañón",
});
$indexer = WebGUI::Search::Index->create( $article );
my $pretty = "schön";
my $canyon = "cañón";
utf8::upgrade($pretty);
utf8::upgrade($canyon);
$row = $db->quickHashRef( "SELECT * FROM assetIndex WHERE assetId=?", [ $article->getId ] );
my $keywords = $row->{keywords};
utf8::upgrade($keywords);
cmp_deeply (
$row,
superhashof({
keywords => all( # keywords contains title, menuTitle, every part of the URL and every keyword
re($pretty),
re("&"),
re($canyon),
),
}),
"Index has decoded entities"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment