View | Details | Raw Unified | Return to bug 11708
Collapse All | Expand All

(-)a/t/db_dependent/Acquisition/Basketgroups.t (-14 / +13 lines)
Lines 22-48 my $basketgroupid = NewBasketgroup({ Link Here
22
});
22
});
23
23
24
my $basketgroup = GetBasketgroup($basketgroupid);
24
my $basketgroup = GetBasketgroup($basketgroupid);
25
ok(!$basketgroup->{closed});
25
ok(!$basketgroup->{closed}, "basket group is open");
26
ok(!defined($basketgroup->{closeddate}));
26
ok(!defined($basketgroup->{closeddate}), "basket group closed date is empty");
27
27
28
CloseBasketgroup($basketgroupid);
28
CloseBasketgroup($basketgroupid);
29
$basketgroup = GetBasketgroup($basketgroupid);
29
$basketgroup = GetBasketgroup($basketgroupid);
30
ok($basketgroup->{closed});
30
ok($basketgroup->{closed}, "basket group is closed");
31
ok(defined($basketgroup->{closeddate}));
31
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
32
my ($day, $month, $year) = (localtime)[3,4,5];
32
my ($day, $month, $year) = (localtime)[3,4,5];
33
ok($basketgroup->{closeddate} eq sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day));
33
ok($basketgroup->{closeddate} eq sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day), "basket group closed date is correct");
34
34
35
ReOpenBasketgroup($basketgroupid);
35
ReOpenBasketgroup($basketgroupid);
36
$basketgroup = GetBasketgroup($basketgroupid);
36
$basketgroup = GetBasketgroup($basketgroupid);
37
ok(!$basketgroup->{closed});
37
ok(!$basketgroup->{closed}, "basket group is open");
38
ok(!defined($basketgroup->{closeddate}));
38
ok(!defined($basketgroup->{closeddate}), "basket group closed date is empty");
39
39
40
$basketgroup->{closed} = 1;
40
$basketgroup->{closed} = 1;
41
ModBasketgroup($basketgroup);
41
ModBasketgroup($basketgroup);
42
$basketgroup = GetBasketgroup($basketgroupid);
42
$basketgroup = GetBasketgroup($basketgroupid);
43
ok($basketgroup->{closed});
43
ok($basketgroup->{closed}, "basket group is closed");
44
ok(defined($basketgroup->{closeddate}));
44
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
45
ok($basketgroup->{closeddate} eq sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day));
45
ok($basketgroup->{closeddate} eq sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day), "basket group closed date is correct");
46
46
47
$basketgroupid = NewBasketgroup({
47
$basketgroupid = NewBasketgroup({
48
    booksellerid => $booksellerid,
48
    booksellerid => $booksellerid,
Lines 50-57 $basketgroupid = NewBasketgroup({ Link Here
50
    closed => 1,
50
    closed => 1,
51
});
51
});
52
$basketgroup = GetBasketgroup($basketgroupid);
52
$basketgroup = GetBasketgroup($basketgroupid);
53
ok($basketgroup->{closed});
53
ok($basketgroup->{closed}, "basket group is closed");
54
ok(defined($basketgroup->{closeddate}));
54
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
55
ok($basketgroup->{closeddate} eq sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day));
55
ok($basketgroup->{closeddate} eq sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day), "basket group closed date is correct");
56
56
57
$dbh->rollback;
57
$dbh->rollback;
58
- 

Return to bug 11708