allow usage of a pool of mediawiki updaters instead of just single-process
[scpubgit/System-Introspector-Report.git] / t / lib / TestConnection.pm
1 package TestConnection;
2 use Moo;
3 use IO::All;
4 use aliased 'System::Introspector::Report::Publish::MediaWiki::Page';
5
6 extends 'System::Introspector::Report::Publish::MediaWiki::Connection';
7
8 sub get {
9   my ($self, $name) = @_;
10   return Page->new(
11     name      => $name,
12     timestamp => 23,
13     content   => scalar(io("$ENV{TEST_SI_REPORT_IN}/$name.txt")->slurp),
14   );
15 }
16
17 sub put {
18   my ($self, $page) = @_;
19   my $out = $ENV{TEST_SI_REPORT_OUT}
20     or die "No output directory";
21   io("$out/" . $page->name)->print($page->content);
22   return 1;
23 }
24
25 1;