- Added the arrayRef() method to WebGUI::SQL::ResultSet, which is 12% faster

than the array() method.
 - Added more tests to the test suite.
This commit is contained in:
JT Smith 2006-07-25 17:58:54 +00:00
parent 03b4b0ed33
commit 6766c63731
4 changed files with 49 additions and 2 deletions

View file

@ -13,7 +13,7 @@ use strict;
use lib "$FindBin::Bin/lib";
use WebGUI::Test;
use Test::More tests => 6; # increment this value for each test you create
use Test::More tests => 12; # increment this value for each test you create
my $config = WebGUI::Test->config;
my $configFile = WebGUI::Test->file;
@ -21,7 +21,34 @@ my $webguiRoot = WebGUI::Test->root;
ok( defined $config, "load config" );
ok( $config->get("dsn") ne "", "get()" );
is( ref $config->get("macros"), "HASH", "get() hash" );
is( ref $config->get("assets"), "ARRAY", "get() array" );
is( $config->getFilename,$configFile,"getFilename()" );
is( $config->getWebguiRoot, $webguiRoot, "getWebguiRoot()" );
ok( exists $WebGUI::Config::config{$configFile}, "loadAllConfigs" );
ok( defined WebGUI::Config->readAllConfigs($webguiRoot), "readAllConfigs" );
$config->addToArray("assets","TEST");
my $found = 0;
foreach my $asset ( @{$config->get("assets")}) {
$found = 1 if ($asset eq "TEST");
}
ok($found, "addToArray()");
$config->deleteFromArray("assets","TEST");
my $found = 0;
foreach my $asset ( @{$config->get("assets")}) {
$found = 1 if ($asset eq "TEST");
}
ok(!$found, "deleteFromArray()");
$config->addToHash("macros","TEST","VALUE");
my $found = 0;
foreach my $macro (keys %{$config->get("macros")}) {
$found = 1 if ($macro eq "TEST" && $config->get("macros")->{$macro} eq "VALUE");
}
ok($found, "addToHash()");
$config->deleteFromHash("macros","TEST");
my $found = 0;
foreach my $macro (keys %{$config->get("macros")}) {
$found = 1 if ($macro eq "TEST");
}
ok(!$found, "deleteFromHash()");