PageRenderTime 50ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/t/27-prefixindex.t

http://perlwikipedia.googlecode.com/
Unknown | 22 lines | 17 code | 5 blank | 0 comment | 0 complexity | 003b2804e624eab5c933ea02e9058012 MD5 | raw file
Possible License(s): GPL-3.0
  1. use strict;
  2. use warnings;
  3. use Test::More tests => 4;
  4. use MediaWiki::Bot;
  5. my $t = __FILE__;
  6. my $bot = MediaWiki::Bot->new({
  7. agent => "MediaWiki::Bot tests ($t)",
  8. host => 'test.wikipedia.org',
  9. });
  10. if(defined($ENV{'PWPMakeTestSetWikiHost'})) {
  11. $bot->set_wiki($ENV{'PWPMakeTestSetWikiHost'}, $ENV{'PWPMakeTestSetWikiDir'});
  12. }
  13. my @pages = $bot->prefixindex('User:Mike.lifeguard/27-prefixindex.t');
  14. is(scalar @pages, 3, 'Correct number of pages');
  15. is($pages[0]->{'title'}, 'User:Mike.lifeguard/27-prefixindex.t', 'Page 0 correct');
  16. is($pages[1]->{'title'}, 'User:Mike.lifeguard/27-prefixindex.t/one', 'Page 1 correct');
  17. is($pages[2]->{'title'}, 'User:Mike.lifeguard/27-prefixindex.t/two', 'Page 2 correct');