6 use aliased 'System::Introspector::Report::Publish::MediaWiki';
11 package TestConnection;
14 use aliased 'System::Introspector::Report::Publish::MediaWiki::Page';
17 my ($self, $name) = @_;
21 content => scalar(io("$FindBin::Bin/data/$name.txt")->slurp),
26 my ($self, $page) = @_;
27 $result{$page->name} = $page->content;
31 my $conn = TestConnection->new;
32 my $wiki = MediaWiki->new(
33 api_uri => 'http://example.com:9999/',
45 { id => [qw( foo a )],
49 { key => 'bar', label => 'Bar' },
50 { key => 'baz', label => 'Baz' },
53 { bar => 231, baz => 421 },
54 { bar => 232, baz => 884 },
55 { bar => 332, baz => 784 },
58 { id => [qw( foo b )],
62 { key => 'bar', label => 'Bar' },
63 { key => 'baz', label => 'Baz' },
66 { bar => 231, baz => 421 },
67 { bar => 332, baz => 784 },
70 { id => [qw( foo c )],
74 { key => 'bar', label => 'New Bar' },
75 { key => 'baz', label => 'New Baz' },
78 { bar => 232, baz => 884 },
79 { bar => 332, baz => 784 },
80 { bar => 989, baz => "foo\nbar" },
87 $string =~ s{[\s\n]+}{}g;
91 ## uncomment to regenerate result file
92 # do { no warnings; $result{foo} > io("$FindBin::Bin/data/result/foo.txt") };
94 is $result{foo}->$_despace,
95 scalar(io("$FindBin::Bin/data/result/foo.txt")->slurp)->$_despace,
96 'resulting page looks correct';