source: wiki-toolkit-plugin-categoriser/trunk/t/nested_categories.t @ 261

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

More renames.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 975 bytes
Line 
1use strict;
2use Wiki::Toolkit::Plugin::Categoriser;
3use Wiki::Toolkit::TestLib;
4use Test::More;
5
6my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
7plan tests => ( $iterator->number * 1 );
8
9while ( my $wiki = $iterator->new_wiki ) {
10    print "#\n##### TEST CONFIG: Store: " . (ref $wiki->store) . "\n";
11
12    my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new;
13    $wiki->register_plugin( plugin => $categoriser );
14
15    $wiki->write_node( "Pub Food", "pubs that serve food", undef,
16                        { category => [ "Pubs", "Food", "Category" ] } )
17      or die "Can't write node";
18
19    $wiki->write_node( "Restaurants", "places that serve food", undef,
20                        { category => [ "Food", "Category" ] } )
21      or die "Can't write node";
22
23    my @subcategories = $categoriser->subcategories( category => "Pubs" );
24    is_deeply( \@subcategories, [ "Pub Food" ],
25     "->subcategories returns things that belong, and not things that don't" );
26}
Note: See TracBrowser for help on using the repository browser.