summaryrefslogtreecommitdiff
path: root/t/openiduser.t
blob: 52d879484ce235d55c242d1b2a8d4505fa34f38f (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. BEGIN {
  5. eval q{
  6. use Net::OpenID::VerifiedIdentity;
  7. };
  8. if ($@) {
  9. eval q{use Test::More skip_all => "Net::OpenID::VerifiedIdentity not available"};
  10. }
  11. else {
  12. eval q{use Test::More tests => 9};
  13. }
  14. use_ok("IkiWiki::Plugin::openid");
  15. }
  16. # Some typical examples:
  17. # This test, when run by Test::Harness using perl -w, exposes a warning in
  18. # Net::OpenID::VerifiedIdentity. Normally that warning is not displayed, as
  19. # that module does not use warnings. To avoid cluttering the test output,
  20. # disable the -w switch temporarily.
  21. $^W=0;
  22. is(IkiWiki::openiduser('http://josephturian.blogspot.com'), 'josephturian [blogspot.com]');
  23. $^W=1;
  24. is(IkiWiki::openiduser('http://yam655.livejournal.com/'), 'yam655 [livejournal.com]');
  25. is(IkiWiki::openiduser('http://id.mayfirst.org/jamie/'), 'jamie [id.mayfirst.org]');
  26. # and some less typical ones taken from the ikiwiki commit history
  27. is(IkiWiki::openiduser('http://thm.id.fedoraproject.org/'), 'thm [id.fedoraproject.org]');
  28. is(IkiWiki::openiduser('http://dtrt.org/'), 'dtrt.org');
  29. is(IkiWiki::openiduser('http://alcopop.org/me/openid/'), 'openid [alcopop.org/me]');
  30. is(IkiWiki::openiduser('http://id.launchpad.net/882/bielawski1'), 'bielawski1 [id.launchpad.net/882]');
  31. is(IkiWiki::openiduser('http://technorati.com/people/technorati/drajt'), 'drajt [technorati.com/people/technorati]');