Changeset 587 for trunk/t


Ignore:
Timestamp:
Dec 14, 2004, 6:46:00 PM (17 years ago)
Author:
kake
Message:

Encapsulate config data in OpenGuides::Config.

Location:
trunk/t
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/01_load.t

    r586 r587  
    1 use Test::More tests => 6;
     1use Test::More tests => 7;
    22
    33use_ok( "OpenGuides" );
    44use_ok( "OpenGuides::CGI" );
     5use_ok( "OpenGuides::Config" );
    56use_ok( "OpenGuides::RDF" );
    67use_ok( "OpenGuides::SuperSearch" );
  • trunk/t/11_utils.t

    r586 r587  
    11use strict;
    2 use Config::Tiny;
     2use OpenGuides::Config;
    33use OpenGuides::Utils;
    44use Test::More tests => 7;
     
    88
    99eval { my $wiki = OpenGuides::Utils->make_wiki_object( config => "foo" ); };
    10 ok( $@, "...and if config param isn't a Config::Tiny object" );
     10ok( $@, "...and if config param isn't an OpenGuides::Config object" );
    1111
    1212eval { require DBD::SQLite; };
     
    1717      unless $have_sqlite;
    1818
    19     my $config = Config::Tiny->new;
    20     $config->{_} = {
     19    my $config = OpenGuides::Config->new(
     20           vars => {
    2121                     dbtype             => "sqlite",
    2222                     dbname             => "t/node.db",
     
    2424                     script_url         => "",
    2525                     script_name        => "",
    26                    };
     26                   }
     27    );
    2728
    2829    my $wiki = eval {
     
    3031    };
    3132    is( $@, "",
    32         "...but not if a Config::Tiny object with suitable data is supplied" );
     33        "...but not with an OpenGuides::Config object with suitable data" );
    3334    isa_ok( $wiki, "CGI::Wiki" );
    3435
  • trunk/t/13_cookies.t

    r586 r587  
    11use strict;
    2 use Config::Tiny;
     2use OpenGuides::Config;
    33use OpenGuides::CGI;
    44use Time::Piece;
     
    1010
    1111eval { OpenGuides::CGI->make_prefs_cookie( config => "foo" ); };
    12 ok( $@, "...or if config isn't a Config::Tiny" );
     12ok( $@, "...or if config isn't an OpenGuides::Config" );
    1313
    14 my $config = Config::Tiny->new;
    15 $config->{_} = {
    16                  site_name => "Test Site",
    17                };
     14my $config = OpenGuides::Config->new( vars => { site_name => "Test Site" } );
    1815
    1916eval { OpenGuides::CGI->make_prefs_cookie( config => $config ); };
     
    5148
    5249eval { OpenGuides::CGI->get_prefs_from_cookie( config => "foo" ); };
    53 ok( $@, "...or if config isn't a Config::Tiny" );
     50ok( $@, "...or if config isn't an OpenGuides::Config" );
    5451
    5552eval { OpenGuides::CGI->get_prefs_from_cookie( config => $config ); };
  • trunk/t/14_recent_changes_cookies.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides;
    55use OpenGuides::CGI;
     
    1212
    1313eval { OpenGuides::CGI->make_recent_changes_cookie( config => "foo" ); };
    14 ok( $@, "...or if config isn't a Config::Tiny" );
     14ok( $@, "...or if config isn't an OpenGuides::Config" );
    1515
    16 my $config = Config::Tiny->new;
    17 $config->{_} = {
    18                  site_name => "Test Site",
    19                };
     16my $config = OpenGuides::Config->new( vars => { site_name => "Test Site" } );
    2017
    2118eval { OpenGuides::CGI->make_recent_changes_cookie( config => $config ); };
     
    4340
    4441eval { OpenGuides::CGI->get_last_recent_changes_visit_from_cookie( config => "foo" ); };
    45 ok( $@, "...or if config isn't a Config::Tiny" );
     42ok( $@, "...or if config isn't an OpenGuides::Config" );
    4643
    4744eval { OpenGuides::CGI->get_last_recent_changes_visit_from_cookie( config => $config ); };
     
    6259
    6360    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    64     my $config = Config::Tiny->new;
    65     $config->{_} = {
     61    my $config = OpenGuides::Config->new(
     62           vars => {
    6663                     dbtype             => "sqlite",
    6764                     dbname             => "t/node.db",
     
    7269                     template_path      => "./templates",
    7370                     home_name          => "Home",
    74                    };
     71                   }
     72    );
    7573    my $guide = OpenGuides->new( config => $config );
    7674
  • trunk/t/15_template.t

    r586 r587  
    11use strict;
    2 use Config::Tiny;
    32use Cwd;
    43use CGI::Cookie;
    54use CGI::Wiki::Formatter::UseMod;
     5use OpenGuides::Config;
    66use OpenGuides::Template;
    77use Test::MockObject;
    88use Test::More tests => 27;
    99
    10 my $config = Config::Tiny->new;
    11 $config->{_} = {
     10my $config = OpenGuides::Config->new(
     11       vars => {
    1212                 template_path         => cwd . '/t/templates',
    1313                 site_name             => 'CGI::Wiki Test Site',
     
    2020                 home_name             => 'Home Page',
    2121                 formatting_rules_node => 'Rules',
    22                };
     22               }
     23);
    2324
    2425# White box testing - we know that OpenGuides::Template only actually uses
     
    112113
    113114# Test that home_link is set correctly when script_name is blank.
    114 $config->{_} = {
     115$config = OpenGuides::Config->new(
     116       vars => {
    115117                 template_path         => cwd . '/t/templates',
    116118                 site_name             => 'CGI::Wiki Test Site',
    117119                 script_url            => 'http://wiki.example.com/',
    118120                 script_name           => '',
    119                };
     121               }
     122);
    120123$output = OpenGuides::Template->output(
    121124    wiki     => $fake_wiki,
     
    128131# Test that full_cgi_url comes out right if the trailing '/' is
    129132# missing from script_url in the config file.
    130 $config->{_} = {
     133$config = OpenGuides::Config->new(
     134       vars => {
    131135                 template_path         => cwd . '/t/templates',
    132136                 site_name             => 'CGI::Wiki Test Site',
    133137                 script_url            => 'http://wiki.example.com',
    134138                 script_name           => 'wiki.cgi',
    135                };
     139               }
     140);
    136141$output = OpenGuides::Template->output(
    137142    wiki     => $fake_wiki,
     
    167172
    168173# Test that enable_page_deletion is set correctly in various circumstances.
    169 $config = Config::Tiny->new;
    170 $config->{_}->{template_path} = cwd . "/t/templates";
    171 $config->{_}->{site_name} = "Test Site";
    172 $config->{_}->{script_url} = "/";
    173 $config->{_}->{script_name} = "";
     174$config = OpenGuides::Config->new(
     175    vars => {
     176              template_path => cwd . "/t/templates",
     177              site_name     => "Test Site",
     178              script_url    => "/",
     179              script_name   => "",
     180            },
     181);
    174182
    175183$output = OpenGuides::Template->output(
     
    181189      "enable_page_deletion var set correctly when not specified in conf" );
    182190
    183 $config->{_}->{enable_page_deletion} = "n";
     191$config->enable_page_deletion( "n" );
    184192$output = OpenGuides::Template->output(
    185193    wiki     => $fake_wiki,
     
    190198      "enable_page_deletion var set correctly when set to 'n' in conf" );
    191199
    192 $config->{_}->{enable_page_deletion} = "y";
     200$config->enable_page_deletion( "y" );
    193201$output = OpenGuides::Template->output(
    194202    wiki     => $fake_wiki,
     
    199207      "enable_page_deletion var set correctly when set to 'y' in conf" );
    200208
    201 $config->{_}->{enable_page_deletion} = 0;
     209$config->enable_page_deletion( 0 );
    202210$output = OpenGuides::Template->output(
    203211    wiki     => $fake_wiki,
     
    208216      "enable_page_deletion var set correctly when set to '0' in conf" );
    209217
    210 $config->{_}->{enable_page_deletion} = 1;
     218$config->enable_page_deletion( 1 );
    211219$output = OpenGuides::Template->output(
    212220    wiki     => $fake_wiki,
  • trunk/t/16_test_tester.t

    r586 r587  
    2323CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    2424my $config = OpenGuides::Test->make_basic_config;
    25 $config->{_}{site_name} = "Test Site";
     25$config->site_name( "Test Site" );
    2626my $guide = OpenGuides->new( config => $config );
    2727
  • trunk/t/21_rdf.t

    r586 r587  
    11use CGI::Wiki::Setup::SQLite;
    2 use Config::Tiny;
     2use OpenGuides::Config;
    33use OpenGuides::RDF;
    44use OpenGuides::Utils;
     
    1414
    1515    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    16     my $config = Config::Tiny->new;
    17     $config->{_} = {
     16    my $config = OpenGuides::Config->new(
     17           vars => {
    1818                     dbtype             => "sqlite",
    1919                     dbname             => "t/node.db",
     
    2424                     default_city       => "London",
    2525                     default_country    => "United Kingdom",
    26                    };
     26                   }
     27    );
    2728
    2829    my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
  • trunk/t/22_rss_modwiki.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides;
    55use OpenGuides::RDF;
     
    2626
    2727CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    28 my $config = Config::Tiny->new;
    29 $config->{_} = {
     28my $config = OpenGuides::Config->new(
     29       vars => {
    3030                 dbtype             => "sqlite",
    3131                 dbname             => "t/node.db",
     
    3737                 home_name          => "Home",
    3838                 use_plucene        => 1
    39                };
     39               }
     40);
    4041
    4142# Basic sanity check first.
  • trunk/t/25_write_geo_data.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides;
    55use OpenGuides::Test;
     
    3737
    3838CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    39 my $config = Config::Tiny->new;
    40 $config->{_} = {
     39my $config = OpenGuides::Config->new(
     40       vars => {
    4141                 dbtype             => "sqlite",
    4242                 dbname             => "t/node.db",
     
    4848                 use_plucene        => 1,
    4949                 geo_handler        => 1,
    50                };
     50               }
     51);
    5152
    5253# First check that British National Grid will accept both OS X/Y and lat/long,
     
    102103
    103104# Now check Irish National Grid.
    104 $config->{_}{geo_handler} = 2;
     105$config->geo_handler( 2 );
    105106$guide = OpenGuides->new( config => $config );
    106107is( $guide->locator->x_field, "osie_x", "correct x field" );
     
    151152
    152153# Finally check UTM.
    153 $config->{_}{geo_handler} = 3;
    154 $config->{_}{ellipsoid} = "Airy";
     154$config->geo_handler( 3 );
     155$config->ellipsoid( "Airy" );
    155156$guide = OpenGuides->new( config => $config );
    156157is( $guide->locator->x_field, "easting", "correct x field" );
  • trunk/t/26_geo_data_search_form.t

    r586 r587  
    4343CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    4444my $config = OpenGuides::Test->make_basic_config;
    45 $config->{_}{use_plucene} = 1;
     45$config->use_plucene( 1 );
    4646
    4747# British National Grid guides should have os_x/os_y/os_dist search fields.
     
    7979
    8080# Irish National Grid guides should have osie_x/osie_y/osie_dist.
    81 $config->{_}{geo_handler} = 2;
     81$config->geo_handler( 2 );
    8282$guide = OpenGuides->new( config => $config );
    8383
     
    110110
    111111# UTM guides should have latitude/longitude/latlong_dist.
    112 $config->{_}{geo_handler} = 3;
    113 $config->{_}{ellipsoid} = "Airy";
     112$config->geo_handler( 3 );
     113$config->ellipsoid( "Airy" );
    114114$guide = OpenGuides->new( config => $config );
    115115
  • trunk/t/27_geo_data_edit_form.t

    r586 r587  
    4444CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    4545my $config = OpenGuides::Test->make_basic_config;
    46 $config->{_}{use_plucene} = 1;
     46$config->use_plucene( 1 );
    4747
    4848# British National Grid guides should have os_x/os_y fields.
     
    8989
    9090# Irish National Grid guides should have osie_x/osie_y fields.
    91 $config->{_}{geo_handler} = 2;
     91$config->geo_handler( 2 );
    9292$guide = OpenGuides->new( config => $config );
    9393$wiki = $guide->wiki;
     
    129129
    130130# UTM guides should have lat/long fields.
    131 $config->{_}{geo_handler} = 3;
    132 $config->{_}{ellipsoid} = "Airy";
     131$config->geo_handler( 3 );
     132$config->ellipsoid( "Airy" );
    133133$guide = OpenGuides->new( config => $config );
    134134$wiki = $guide->wiki;
  • trunk/t/31_supersearch.t

    r586 r587  
    1717    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1818    my $config = OpenGuides::Test->make_basic_config;
    19     $config->{_}{script_name} = "wiki.cgi";
    20     $config->{_}{script_url} = "http://example.com/";
     19    $config->script_name( "wiki.cgi" );
     20    $config->script_url( "http://example.com/" );
    2121
    2222    # Plucene is the recommended searcher now.
    2323    eval { require CGI::Wiki::Search::Plucene; };
    2424    unless ( $@ ) {
    25         $config->{_}{use_plucene} = 1;
     25        $config->use_plucene( 1 );
    2626    }
    2727
  • trunk/t/32_supersearch_simple_metadata.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides::SuperSearch;
    55use Test::More tests => 10;
     
    1717
    1818    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    19     my $config = Config::Tiny->new;
    20     $config->{_} = {
     19    my $config = OpenGuides::Config->new(
     20           vars => {
    2121                     dbtype             => "sqlite",
    2222                     dbname             => "t/node.db",
     
    2626                     site_name          => "Test Site",
    2727                     template_path      => "./templates",
    28                    };
     28                   }
     29    );
    2930
    3031    # Plucene is the recommended searcher now.
    3132    eval { require CGI::Wiki::Search::Plucene; };
    3233    unless ( $@ ) {
    33         $config->{_}{use_plucene} = 1;
     34        $config->use_plucene( 1 );
    3435    }
    3536
  • trunk/t/33_supersearch_advanced_search.t

    r586 r587  
    22use CGI::Wiki::Plugin::Locator::Grid; # use directly to help debug
    33use CGI::Wiki::Setup::SQLite;
    4 use Config::Tiny;
     4use OpenGuides::Config;
    55use OpenGuides::SuperSearch;
    66use OpenGuides::Test;
     
    2929CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    3030
    31 my $config = Config::Tiny->new;
    32 $config->{_} = {
     31my $config = OpenGuides::Config->new(
     32       vars => {
    3333                 dbtype             => "sqlite",
    3434                 dbname             => "t/node.db",
     
    4040                 use_plucene        => 1,
    4141                 geo_handler        => 1,
    42            };
     42           }
     43);
    4344my $search = OpenGuides::SuperSearch->new( config => $config );
    4445my $guide = OpenGuides->new( config => $config );
  • trunk/t/33_supersearch_advanced_search_utm.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides::SuperSearch;
    55use OpenGuides::Test;
     
    2828CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    2929
    30 my $config = Config::Tiny->new;
    31 $config->{_} = {
     30my $config = OpenGuides::Config->new(
     31       vars => {
    3232                 dbtype             => "sqlite",
    3333                 dbname             => "t/node.db",
     
    4040                 geo_handler        => 3,
    4141                 ellipsoid          => "Airy",
    42            };
     42           }
     43);
    4344my $search = OpenGuides::SuperSearch->new( config => $config );
    4445my $guide = OpenGuides->new( config => $config );
  • trunk/t/34_supersearch_paging.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides::SuperSearch;
    55use OpenGuides::Test;
     
    2424
    2525my $config = OpenGuides::Test->make_basic_config;
    26 $config->{_}{use_plucene} = 1;
     26$config->use_plucene( 1 );
    2727my $search = OpenGuides::SuperSearch->new( config => $config );
    2828my $guide = OpenGuides->new( config => $config );
     
    3232SKIP: {
    3333    skip "Geography::NationalGrid::GB not installed", 1 if $@;
    34     $config->{_}{geo_handler} = 1;
     34    $config->geo_handler( 1 );
    3535
    3636    foreach my $i ( 1 .. 30 ) {
     
    6767    # We must create a new search object after changing the geo_handler
    6868    # in order to force it to create a fresh locator.
    69     $config->{_}{geo_handler} = 2;
     69    $config->geo_handler( 2 );
    7070    my $search = OpenGuides::SuperSearch->new( config => $config );
    7171
     
    102102    # We must create a new search object after changing the geo_handler
    103103    # in order to force it to create a fresh locator.
    104     $config->{_}{geo_handler} = 3;
    105     $config->{_}{ellipsoid} = "International";
     104    $config->geo_handler( 3 );
    106105    my $search = OpenGuides::SuperSearch->new( config => $config );
    107106
  • trunk/t/35_supersearch_two_searches.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides::SuperSearch;
    55use Test::More;
     
    3131
    3232CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    33 my $config = Config::Tiny->new;
    34 $config->{_} = {
     33my $config = OpenGuides::Config->new(
     34       vars => {
    3535                 dbtype             => "sqlite",
    3636                 dbname             => "t/node.db",
     
    4141                 template_path      => "./templates",
    4242                 geo_handler        => 1,
    43                };
     43               }
     44);
    4445
    4546# Plucene is the recommended searcher now.
    4647eval { require CGI::Wiki::Search::Plucene; };
    4748unless ( $@ ) {
    48     $config->{_}{use_plucene} = 1;
     49    $config->use_plucene( 1 );
    4950}
    5051
     
    101102
    102103# Now with Irish National Grid.
    103 $config->{_}{geo_handler} = 2;
     104$config->geo_handler( 2 );
    104105$search = OpenGuides::SuperSearch->new( config => $config );
    105106$search->run(
     
    115116
    116117# Now with UTM.
    117 $config->{_}{geo_handler} = 3;
    118 $config->{_}{ellipsoid} = "Airy";
     118$config->geo_handler( 3 );
     119$config->ellipsoid( "Airy" );
    119120$search = OpenGuides::SuperSearch->new( config => $config );
    120121$search->run(
  • trunk/t/36_supersearch_order.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides::SuperSearch;
    55use Test::More;
     
    2424
    2525CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    26 my $config = Config::Tiny->new;
    27 $config->{_} = {
     26my $config = OpenGuides::Config->new(
     27       vars => {
    2828                 dbtype             => "sqlite",
    2929                 dbname             => "t/node.db",
     
    3434                 template_path      => "./templates",
    3535                 use_plucene        => 1
    36                };
     36               }
     37);
    3738
    3839my $search = OpenGuides::SuperSearch->new( config => $config );
  • trunk/t/37_supersearch_summaries.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides::SuperSearch;
    55use Test::More;
     
    1616
    1717    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    18     my $config = Config::Tiny->new;
    19     $config->{_} = {
     18    my $config = OpenGuides::Config->new(
     19           vars => {
    2020                     dbtype             => "sqlite",
    2121                     dbname             => "t/node.db",
     
    2525                     site_name          => "Test Site",
    2626                     template_path      => "./templates",
    27                    };
     27                   }
     28    );
    2829
    2930    # Plucene is the recommended searcher now.
    3031    eval { require CGI::Wiki::Search::Plucene; };
    3132    unless ( $@ ) {
    32         $config->{_}{use_plucene} = 1;
     33        $config->use_plucene( 1 );
    3334    }
    3435
  • trunk/t/38_supersearch_params.t

    r586 r587  
    22use CGI;
    33use CGI::Wiki::Setup::SQLite;
    4 use Config::Tiny;
     4use OpenGuides::Config;
    55use OpenGuides::SuperSearch;
    66use Test::More;
     
    3838
    3939CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    40 my $config = Config::Tiny->new;
    41 $config->{_} = {
     40my $config = OpenGuides::Config->new(
     41       vars => {
    4242                 dbtype             => "sqlite",
    4343                 dbname             => "t/node.db",
     
    4949                 use_plucene        => 1,
    5050                 geo_handler        => 1, # British National Grid
    51                };
     51               }
     52);
    5253
    5354# Check the British National Grid case.
     
    9495
    9596# Check the Irish National Grid case.
    96 $config->{_}{geo_handler} = 2; # Irish National Grid
     97$config->geo_handler( 2 );
    9798
    9899$q = CGI->new( "" );
     
    138139
    139140# Check the UTM case.
    140 $config->{_}{geo_handler} = 3; # UTM
    141 $config->{_}{ellipsoid} = "Airy";
     141$config->geo_handler( 3 );
     142$config->ellipsoid( "Airy" );
    142143
    143144$q = CGI->new( "" );
  • trunk/t/39_supersearch_form.t

    r586 r587  
    4343CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    4444my $config = OpenGuides::Test->make_basic_config;
    45 $config->{_}{use_plucene} = 1;
     45$config->use_plucene( 1 );
    4646
    4747# British National Grid guides should have os and latlong search fields.
     
    7171
    7272# Irish National Grid guides should have osie and latlong.
    73 $config->{_}{geo_handler} = 2;
     73$config->geo_handler( 2 );
    7474$search = OpenGuides::SuperSearch->new( config => $config );
    7575$output = $search->run( return_output => 1 );
     
    9696
    9797# UTM guides should have latitude/longitude/latlong_dist only.
    98 $config->{_}{geo_handler} = 3;
    99 $config->{_}{ellipsoid} = "Airy";
     98$config->geo_handler( 3 );
     99$config->ellipsoid( "Airy" );
    100100$search = OpenGuides::SuperSearch->new( config => $config );
    101101$output = $search->run( return_output => 1 );
  • trunk/t/41_deletion.t

    r586 r587  
    77
    88my $config = OpenGuides::Test->make_basic_config;
    9 $config->{_}->{site_name} = "Test Site";
    10 $config->{_}->{script_url} = "/";
     9$config->site_name( "Test Site" );
     10$config->script_url( "/" );
    1111
    1212# White box testing - we know that OpenGuides::Template only actually uses
     
    2525unlike( $output, qr/action=delete/,
    2626        "doesn't offer page deletion link by default" );
    27 $config->{_}->{enable_page_deletion} = "y";
     27$config->enable_page_deletion( "y" );
    2828$output = OpenGuides::Template->output(
    2929    wiki     => $fake_wiki,
     
    3333like( $output, qr/action=delete/,
    3434      "...but does when enable_page_deletion is set to 'y'" );
    35 $config->{_}->{enable_page_deletion} = "1";
     35$config->enable_page_deletion( 1 );
    3636$output = OpenGuides::Template->output(
    3737    wiki     => $fake_wiki,
  • trunk/t/51_display_node.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides;
    55use Test::More tests => 5;
     
    1313
    1414    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    15     my $config = Config::Tiny->new;
    16     $config->{_} = {
     15    my $config = OpenGuides::Config->new(
     16           vars => {
    1717                     dbtype             => "sqlite",
    1818                     dbname             => "t/node.db",
     
    2323                     template_path      => "./templates",
    2424                     home_name          => "Home",
    25                    };
     25                   }
     26    );
    2627    my $guide = OpenGuides->new( config => $config );
    2728    isa_ok( $guide, "OpenGuides" );
     
    3435    is( $@, "", "->display_node doesn't die" );
    3536
    36     $config->{_}->{home_name} = "My Home Page";
     37    $config->home_name( "My Home Page" );
    3738    $output = $guide->display_node( return_output => 1 );
    3839    like( $output, qr/My Home Page/, "...and defaults to the home node, and takes notice of what we want to call it" );
  • trunk/t/53_show_index.t

    r586 r587  
    1414    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1515    my $config = OpenGuides::Test->make_basic_config;
    16     $config->{_}{script_name} = "wiki.cgi";
    17     $config->{_}{script_url} = "http://example.com/";
     16    $config->script_name( "wiki.cgi" );
     17    $config->script_url( "http://example.com/" );
    1818    my $guide = OpenGuides->new( config => $config );
    1919    isa_ok( $guide, "OpenGuides" );
  • trunk/t/54_redirect.t

    r586 r587  
    11use strict;
    22use CGI::Wiki::Setup::SQLite;
    3 use Config::Tiny;
     3use OpenGuides::Config;
    44use OpenGuides;
    55use Test::More tests => 2;
     
    1313
    1414    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    15     my $config = Config::Tiny->new;
    16     $config->{_} = {
     15    my $config = OpenGuides::Config->new(
     16           vars => {
    1717                     dbtype             => "sqlite",
    1818                     dbname             => "t/node.db",
     
    2222                     site_name          => "Test Site",
    2323                     template_path      => "./templates",
    24                    };
     24                   }
     25    );
    2526    my $guide = OpenGuides->new( config => $config );
    2627    my $wiki = $guide->wiki;
  • trunk/t/55_node_history.t

    r586 r587  
    1414    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    1515    my $config = OpenGuides::Test->make_basic_config;
    16     $config->{_}{script_name} = "mywiki.cgi";
    17     $config->{_}{script_url} = "http://example.com/";
     16    $config->script_name( "mywiki.cgi" );
     17    $config->script_url( "http://example.com/" );
    1818    my $guide = OpenGuides->new( config => $config );
    1919
  • trunk/t/62_bug_os_coords.t

    r586 r587  
    11use CGI::Wiki::Setup::SQLite;
    2 use Config::Tiny;
     2use OpenGuides::Config;
    33use Cwd;
    44use OpenGuides::Template;
     
    1414
    1515    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    16     my $config = Config::Tiny->new;
    17     $config->{_} = {
     16    my $config = OpenGuides::Config->new(
     17           vars => {
    1818                     dbtype             => "sqlite",
    1919                     dbname             => "t/node.db",
     
    2424                     template_path      => cwd . "/templates",
    2525                     geo_handler        => 1,
    26                    };
     26                   }
     27    );
    2728
    2829    my $wiki = OpenGuides::Utils->make_wiki_object( config => $config );
  • trunk/t/64_bug_node_history.t

    r586 r587  
    11use CGI::Wiki::Setup::SQLite;
    2 use Config::Tiny;
     2use OpenGuides::Config;
    33use Cwd;
    44use OpenGuides;
     
    1414    CGI::Wiki::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
    1515    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    16     my $config = Config::Tiny->new;
    17     $config->{_} = {
     16    my $config = OpenGuides::Config->new(
     17           vars => {
    1818                     dbtype             => "sqlite",
    1919                     dbname             => "t/node.db",
     
    2323                     site_name          => "CGI::Wiki Test Site",
    2424                     template_path      => cwd . "/templates",
    25                    };
     25                   }
     26    );
    2627
    2728    my $guide = OpenGuides->new( config => $config );
  • trunk/t/65_bug_metadata_escape.t

    r586 r587  
    11use CGI::Wiki::Setup::SQLite;
    2 use Config::Tiny;
     2use OpenGuides::Config;
    33use Cwd;
    44use OpenGuides;
     
    1313    CGI::Wiki::Setup::SQLite::cleardb( { dbname => "t/node.db" } );
    1414    CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    15     my $config = Config::Tiny->new;
    16     $config->{_} = {
     15    my $config = OpenGuides::Config->new(
     16           vars => {
    1717                     dbtype             => "sqlite",
    1818                     dbname             => "t/node.db",
     
    2222                     site_name          => "CGI::Wiki Test Site",
    2323                     template_path      => cwd . "/templates",
    24                    };
     24                   }
     25    );
    2526
    2627    my $guide = OpenGuides->new( config => $config );
  • trunk/t/66_bug_latlong_representation.t

    r586 r587  
    22use CGI;
    33use CGI::Wiki::Setup::SQLite;
    4 use Config::Tiny;
     4use OpenGuides::Config;
    55use OpenGuides::CGI;
    66use OpenGuides;
     
    2525
    2626CGI::Wiki::Setup::SQLite::setup( { dbname => "t/node.db" } );
    27 my $config = Config::Tiny->new;
    28 $config->{_} = {
     27my $config = OpenGuides::Config->new(
     28       vars => {
    2929                 dbtype             => "sqlite",
    3030                 dbname             => "t/node.db",
     
    3737                 geo_handler        => 3, # Test w/ UTM - nat grids use X/Y
    3838                 ellipsoid          => "Airy",
    39                };
     39               }
     40);
    4041
    4142# Plucene is the recommended searcher now.
    4243eval { require CGI::Wiki::Search::Plucene; };
    4344unless ( $@ ) {
    44     $config->{_}{use_plucene} = 1;
     45    $config->use_plucene( 1 );
    4546}
    4647
Note: See TracChangeset for help on using the changeset viewer.