source: trunk/t/64_bug_node_history.t @ 785

Last change on this file since 785 was 785, checked in by Dominic Hargreaves, 15 years ago

Use Wiki::Toolkit. Note that CGI::Wiki::Plugin::Diff hasn't been converted yet,
so tests will be broken for now.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1use Wiki::Toolkit::Setup::SQLite;
2use OpenGuides::Config;
3use Cwd;
4use OpenGuides;
5use Test::More tests => 1;
6
7eval { require DBD::SQLite; };
8my $have_sqlite = $@ ? 0 : 1;
9
10SKIP: {
11    skip "DBD::SQLite not installed - no database to test with", 1
12      unless $have_sqlite;
13
14    Wiki::Toolkit::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
15    Wiki::Toolkit::Setup::SQLite::setup( { dbname => "t/node.db" } );
16    my $config = OpenGuides::Config->new(
17           vars => {
18                     dbtype             => "sqlite",
19                     dbname             => "t/node.db",
20                     indexing_directory => "t/indexes",
21                     script_url         => "http://wiki.example.com/",
22                     script_name        => "mywiki.cgi",
23                     site_name          => "Wiki::Toolkit Test Site",
24                     template_path      => cwd . "/templates",
25                   }
26    );
27    eval { require Wiki::Toolkit::Search::Plucene; };
28    if ( $@ ) { $config->use_plucene ( 0 ) };
29
30    my $guide = OpenGuides->new( config => $config );
31
32    $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", undef, { comment => "<myfaketag>" } ) or die "Can't write node";
33    my %data = $guide->wiki->retrieve_node( "South Croydon Station" );
34    $guide->wiki->write_node( "South Croydon Station", "A sleepy main-line station in what is arguably the nicest part of Croydon.", $data{checksum}, { comment => "<myfaketag>" } ) or die "Can't write node";
35
36    my $output = $guide->list_all_versions(
37                                            id => "South Croydon Station",
38                                            return_output => 1,
39                                          );
40    unlike( $output, qr'<myfaketag>', "HTML escaped in comments" );
41}
42
Note: See TracBrowser for help on using the repository browser.