/tags/2.3/t/15_test_block_hist.t

http://perlwikipedia.googlecode.com/ · Raku · 25 lines · 9 code · 9 blank · 7 comment · 0 complexity · 9442888977c144a07b1dabfa288d6d3b MD5 · raw file

  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. # change 'tests => 1' to 'tests => last_test_to_print';
  5. use Test::More tests => 1;
  6. #########################
  7. # Insert your test code below, the Test::More module is use()ed here so read
  8. # its man page ( perldoc Test::More ) for help writing this test script.
  9. use strict;
  10. use MediaWiki::Bot;
  11. my $wikipedia = MediaWiki::Bot->new("PWP test");
  12. if(defined($ENV{'PWPMakeTestSetWikiHost'})) {
  13. $wikipedia->set_wiki($ENV{'PWPMakeTestSetWikiHost'}, $ENV{'PWPMakeTestSetWikiDir'});
  14. }
  15. my $result = $wikipedia->test_block_hist("User:Jimbo Wales");
  16. is($result, 1, "block history");