Ported all tests
This commit is contained in:
parent
734484f48e
commit
83d59837fd
15 changed files with 84 additions and 318 deletions
|
|
@ -8,15 +8,16 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
use Test::More tests => 22; # increment this value for each test you create
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $wgbday = 997966800;
|
||||
ok($session->datetime->addToDate($wgbday,1,2,3) >= $wgbday+1*60*60*24*365+2*60*60*24*28+3*60*60*24, "addToDate()");
|
||||
|
|
@ -46,20 +47,3 @@ is($session->datetime->secondsToTime(60*60*8),"08:00:00", "secondsToTime()");
|
|||
is($session->datetime->setToEpoch("2001-08-16 08:00:00"), $wgbday, "setToEpoch()");
|
||||
ok($session->datetime->time() > $wgbday,"time()");
|
||||
is($session->datetime->timeToSeconds("08:00:00"), 60*60*8, "timeToSeconds()");
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,37 +8,15 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
|
||||
use Test::More tests => 1; # increment this value for each test you create
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
ok($session->env->get("PATH") ne "", "get()");
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,18 +8,17 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
|
||||
use Test::More tests => 2; # increment this value for each test you create
|
||||
use WebGUI::Utility;
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
# generate
|
||||
my $generateId = $session->id->generate();
|
||||
|
|
@ -33,24 +32,3 @@ for (1..2000) {
|
|||
push(@uniqueIds,$id);
|
||||
}
|
||||
ok($isUnique, "generate() - unique");
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,38 +8,16 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
|
||||
use Test::More tests => 2; # increment this value for each test you create
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
ok($session->os->get("name") ne "", "get(name)");
|
||||
ok($session->os->get("type") eq "Windowsish" || $session->os->get("type") eq "Linuxish", "get(type)");
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,15 +8,16 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
use Test::More tests => 4; # increment this value for each test you create
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
$session->setting->add("test","XXX");
|
||||
my ($value) = $session->db->quickArray("select value from settings where name='test'");
|
||||
|
|
@ -28,20 +29,3 @@ is($value, 'YYY', "set()");
|
|||
$session->setting->remove("test");
|
||||
my ($value) = $session->db->quickArray("select value from settings where name='test'");
|
||||
is($value, undef, "delete()");
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,16 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
use Test::More tests => 22; # increment this value for each test you create
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
# put your tests here
|
||||
|
||||
|
|
@ -36,20 +37,3 @@ $stow->delete("Test1");
|
|||
is($stow->get("Test1"), undef, "delete()");
|
||||
$stow->deleteAll;
|
||||
is($stow->get("Test2"), undef, "deleteAll()");
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,15 +8,16 @@
|
|||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# ---- BEGIN DO NOT EDIT ----
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib '../../lib';
|
||||
use Getopt::Long;
|
||||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
# ---- END DO NOT EDIT ----
|
||||
|
||||
use Test::More tests => 6; # increment this value for each test you create
|
||||
|
||||
my $session = initialize(); # this line is required
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
|
||||
ok($session->var->getId ne "", "getId()");
|
||||
|
|
@ -30,21 +31,3 @@ my $id = $session->var->getId;
|
|||
$session->var->end;
|
||||
my ($count) = $session->db->quickArray("select count(*) from userSession where sessionId=".$session->db->quote($id));
|
||||
ok($count == 0,"end()");
|
||||
|
||||
|
||||
cleanup($session); # this line is required
|
||||
|
||||
# ---- DO NOT EDIT BELOW THIS LINE -----
|
||||
sub initialize {
|
||||
$|=1; # disable output buffering
|
||||
my $configFile;
|
||||
GetOptions(
|
||||
'configFile=s'=>\$configFile
|
||||
);
|
||||
exit 1 unless ($configFile);
|
||||
my $session = WebGUI::Session->open("../..",$configFile);
|
||||
}
|
||||
sub cleanup {
|
||||
my $session = shift;
|
||||
$session->close();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue