adding test for AdminConsole so nothing, uh, gets inadvertently deleted :)
This commit is contained in:
parent
e0c211361e
commit
8989c46a59
1 changed files with 49 additions and 0 deletions
49
t/i18n/adminConsole.t
Normal file
49
t/i18n/adminConsole.t
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2007 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use FindBin;
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib "$FindBin::Bin/../lib"; ##t/lib
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Session;
|
||||
|
||||
#The goal of this test is to verify all the i18n labels in
|
||||
#the Admin Console functions
|
||||
|
||||
use Test::More; # increment this value for each test you create
|
||||
my $numTests = 0;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
my $lib = WebGUI::Test->lib;
|
||||
|
||||
# put your tests here
|
||||
|
||||
my $ac = WebGUI::AdminConsole->new($session);
|
||||
|
||||
my %consoleFuncs = %{ $ac->getAdminFunction('', 1) };
|
||||
|
||||
|
||||
$numTests = scalar keys %consoleFuncs;
|
||||
|
||||
plan tests => $numTests;
|
||||
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
|
||||
my ($label, $func);
|
||||
while ( ($label, $func) = each %consoleFuncs ) {
|
||||
ok($i18n->get(@{ $func->{title} }{qw(id namespace )} ),
|
||||
sprintf "The title for %s, tag: %s, namespace: %s exists", $label, @{ $func->{title} }{'id', 'namespace'});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue