Changeset 1062

Show
Ignore:
Timestamp:
06/10/07 18:13:36 (1 year ago)
Author:
kake
Message:

Apply Andrew's patch, fixes #212 (uninitialised value warnings in test 70). Incidental change: use OpenGuides::Test->write_data instead of Wiki::Toolkit->write_node, hence change in number at line 59, since OpenGuides::Test autocreates categories and locales and Wiki::Toolkit doesn't.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/t/70_admin_home.t

    r959 r1062  
    3030 
    3131# Add 3 different pages, one of which with two versions 
    32 $wiki->write_node( "Test Page", "foo", undef, 
    33                    { category => "Alpha" } ) 
    34   or die "Couldn't write node"; 
    35 $wiki->write_node( "Test Page 2", "foo", undef, 
    36                    { category => "Alpha" } ) 
    37   or die "Couldn't write node"; 
    38 $wiki->write_node( "Locale Bar", "foo", undef, 
    39                    { category => "Locales" } ) 
    40   or die "Couldn't write locale"; 
    41 my %data = $wiki->retrieve_node( "Locale Bar" ); 
    42 $wiki->write_node( "Locale Bar", "foo version 2", $data{checksum}, 
    43                    { category => "Locales" } ) 
    44   or die "Couldn't write locale for the 2nd time"; 
     32OpenGuides::Test->write_data( 
     33     guide         => $guide, 
     34     node          => "Test Page",  
     35     categories    => "Alpha", 
     36     return_output => 1  ); 
     37OpenGuides::Test->write_data( 
     38      guide        => $guide, 
     39      node         =>  "Test Page 2",  
     40      categories    => "Alpha", 
     41      return_output => 1  ); 
     42OpenGuides::Test->write_data( 
     43      guide      => $guide, 
     44      node       =>  "Locale Bar",  
     45      categories  => "Locales", 
     46      return_output => 1  ); 
     47OpenGuides::Test->write_data( 
     48      guide      => $guide, 
     49      node       =>  "Locale Bar",  
     50      categories  => "Locales", 
     51     return_output => 1  ); 
    4552 
    4653 
     
    5360is( scalar @{$ttvars{'nodes'}}, 2, "Right number of nodes" ); 
    5461is( scalar @{$ttvars{'locales'}}, 1, "Right number of locales" ); 
    55 is( scalar @{$ttvars{'categories'}}, 0, "Right number of categories" ); 
     62is( scalar @{$ttvars{'categories'}}, 2, "Right number of categories" ); 
    5663 
    5764my @node_names = map { $_->{name}; } @{$ttvars{nodes}};