PageRenderTime 32ms CodeModel.GetById 23ms app.highlight 5ms RepoModel.GetById 1ms 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
 1use strict;
 2use warnings;
 3use Test::More tests => 4;
 4
 5use MediaWiki::Bot;
 6my $t = __FILE__;
 7
 8my $bot = MediaWiki::Bot->new({
 9    agent   => "MediaWiki::Bot tests ($t)",
10    host    => 'test.wikipedia.org',
11});
12
13if(defined($ENV{'PWPMakeTestSetWikiHost'})) {
14    $bot->set_wiki($ENV{'PWPMakeTestSetWikiHost'}, $ENV{'PWPMakeTestSetWikiDir'});
15}
16
17my @pages = $bot->prefixindex('User:Mike.lifeguard/27-prefixindex.t');
18
19is(scalar @pages, 3, 'Correct number of pages');
20is($pages[0]->{'title'}, 'User:Mike.lifeguard/27-prefixindex.t',     'Page 0 correct');
21is($pages[1]->{'title'}, 'User:Mike.lifeguard/27-prefixindex.t/one', 'Page 1 correct');
22is($pages[2]->{'title'}, 'User:Mike.lifeguard/27-prefixindex.t/two', 'Page 2 correct');