Some test fixes.
This commit is contained in:
parent
074840d27b
commit
db59a2eb7a
3 changed files with 6 additions and 9 deletions
|
|
@ -13,7 +13,7 @@ use strict;
|
||||||
use lib "$FindBin::Bin/lib";
|
use lib "$FindBin::Bin/lib";
|
||||||
|
|
||||||
use WebGUI::Test;
|
use WebGUI::Test;
|
||||||
use Test::More tests => 15; # increment this value for each test you create
|
use Test::More tests => 14; # increment this value for each test you create
|
||||||
use Test::Deep;
|
use Test::Deep;
|
||||||
|
|
||||||
my $config = WebGUI::Test->config;
|
my $config = WebGUI::Test->config;
|
||||||
|
|
@ -26,7 +26,6 @@ is( ref $config->get("macros"), "HASH", "get() hash" );
|
||||||
is( ref $config->get("assets"), "ARRAY", "get() array" );
|
is( ref $config->get("assets"), "ARRAY", "get() array" );
|
||||||
is( $config->getFilename,$configFile,"getFilename()" );
|
is( $config->getFilename,$configFile,"getFilename()" );
|
||||||
is( $config->getWebguiRoot, $webguiRoot, "getWebguiRoot()" );
|
is( $config->getWebguiRoot, $webguiRoot, "getWebguiRoot()" );
|
||||||
ok( exists $WebGUI::Config::config{$configFile}, "loadAllConfigs" );
|
|
||||||
ok( defined WebGUI::Config->readAllConfigs($webguiRoot), "readAllConfigs" );
|
ok( defined WebGUI::Config->readAllConfigs($webguiRoot), "readAllConfigs" );
|
||||||
$config->addToArray("assets","TEST");
|
$config->addToArray("assets","TEST");
|
||||||
my $found = 0;
|
my $found = 0;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ my $testBlock = [
|
||||||
|
|
||||||
my $formType = 'textarea';
|
my $formType = 'textarea';
|
||||||
|
|
||||||
my $numTests = 12 + scalar @{ $testBlock } + 5;
|
my $numTests = 7 + scalar @{ $testBlock } + 5;
|
||||||
|
|
||||||
|
|
||||||
plan tests => $numTests;
|
plan tests => $numTests;
|
||||||
|
|
@ -74,9 +74,6 @@ my $input = $inputs[0];
|
||||||
is($input->name, 'TestText', 'Checking input name');
|
is($input->name, 'TestText', 'Checking input name');
|
||||||
is($input->type, $formType, 'Checking input type');
|
is($input->type, $formType, 'Checking input type');
|
||||||
is($input->value, 'Some text in here', 'Checking default value');
|
is($input->value, 'Some text in here', 'Checking default value');
|
||||||
like($input->{style}, qr/width:\s+\d+px;\s+height:\s+\d+px/, 'basic style format');
|
|
||||||
like($input->{style}, qr/height: 150/, 'Default height');
|
|
||||||
like($input->{style}, qr/width: 400/, 'Default width');
|
|
||||||
|
|
||||||
$html = join "\n",
|
$html = join "\n",
|
||||||
$header,
|
$header,
|
||||||
|
|
@ -93,8 +90,6 @@ $html = join "\n",
|
||||||
$input = $inputs[0];
|
$input = $inputs[0];
|
||||||
is($input->name, 'preTestText', 'Checking input name');
|
is($input->name, 'preTestText', 'Checking input name');
|
||||||
is($input->value, 'Some & text in " here', 'Checking default value');
|
is($input->value, 'Some & text in " here', 'Checking default value');
|
||||||
like($input->{style}, qr/height: 200/, 'Custom height');
|
|
||||||
like($input->{style}, qr/width: 500/, 'Custom width');
|
|
||||||
|
|
||||||
##Test Form Output parsing
|
##Test Form Output parsing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,8 @@ is( $url2, $url.'?a=b;c=d', 'append second pair');
|
||||||
#
|
#
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
$session->config->{_config}->{'gateway'} = '/';
|
my $gateway = $session->config->get('gateway');
|
||||||
|
$session->config->set('gateway', '/');
|
||||||
|
|
||||||
is( $session->config->get('gateway'), '/', 'Set gateway for downstream tests');
|
is( $session->config->get('gateway'), '/', 'Set gateway for downstream tests');
|
||||||
|
|
||||||
|
|
@ -316,6 +317,8 @@ END { ##Always clean-up
|
||||||
$session->config->set('sitename', \@config_sitename);
|
$session->config->set('sitename', \@config_sitename);
|
||||||
$session->setting->set('hostToUse', $setting_hostToUse);
|
$session->setting->set('hostToUse', $setting_hostToUse);
|
||||||
$session->setting->set('preventProxyCache', $preventProxyCache);
|
$session->setting->set('preventProxyCache', $preventProxyCache);
|
||||||
|
$session->config->set('gateway', $gateway);
|
||||||
|
|
||||||
if ($config_port) {
|
if ($config_port) {
|
||||||
$session->config->set($config_port);
|
$session->config->set($config_port);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue