PageRenderTime 42ms CodeModel.GetById 34ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/3.2/t/29_prefixindex.t

http://perlwikipedia.googlecode.com/
Unknown | 28 lines | 19 code | 9 blank | 0 comment | 0 complexity | 6194cb00c4676bf2e7c8423e716e4504 MD5 | raw file
Possible License(s): GPL-3.0
 1# Before `make install' is performed this script should be runnable with
 2# `make test'. After `make install' it should work as `perl MediaWiki::Bot.t'
 3
 4#########################
 5
 6use strict;
 7use warnings;
 8use Test::More tests => 4;
 9
10#########################
11
12use MediaWiki::Bot;
13
14my $bot = MediaWiki::Bot->new({
15    agent   => 'MediaWiki::Bot tests (29_prefixindex.t)',
16});
17
18if(defined($ENV{'PWPMakeTestSetWikiHost'})) {
19    $bot->set_wiki($ENV{'PWPMakeTestSetWikiHost'}, $ENV{'PWPMakeTestSetWikiDir'});
20}
21
22my @pages = $bot->prefixindex("User:Mike.lifeguard/29 prefixindex.t");
23
24is(scalar @pages, 3, 'Correct number of pages');
25is($pages[0]->{'title'}, 'User:Mike.lifeguard/29 prefixindex.t',     'Page 0 correct');
26is($pages[1]->{'title'}, 'User:Mike.lifeguard/29 prefixindex.t/one', 'Page 1 correct');
27is($pages[2]->{'title'}, 'User:Mike.lifeguard/29 prefixindex.t/two', 'Page 2 correct');
28