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

(-)a/t/db_dependent/Acquisition/Basketgroups.t (-5 / +6 lines)
Lines 2-7 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use DateTime;
6
5
use C4::Context;
7
use C4::Context;
6
use C4::Acquisition;
8
use C4::Acquisition;
7
use C4::Bookseller qw/ AddBookseller /;
9
use C4::Bookseller qw/ AddBookseller /;
Lines 29-36 CloseBasketgroup($basketgroupid); Link Here
29
$basketgroup = GetBasketgroup($basketgroupid);
31
$basketgroup = GetBasketgroup($basketgroupid);
30
ok($basketgroup->{closed}, "basket group is closed");
32
ok($basketgroup->{closed}, "basket group is closed");
31
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
33
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
32
my ($day, $month, $year) = (localtime)[3,4,5];
34
my $today = DateTime->now(time_zone => C4::Context->tz);
33
is($basketgroup->{closeddate}, sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day), "basket group closed date is correct");
35
is($basketgroup->{closeddate}, $today->ymd, "basket group closed date is correct");
34
36
35
ReOpenBasketgroup($basketgroupid);
37
ReOpenBasketgroup($basketgroupid);
36
$basketgroup = GetBasketgroup($basketgroupid);
38
$basketgroup = GetBasketgroup($basketgroupid);
Lines 42-48 ModBasketgroup($basketgroup); Link Here
42
$basketgroup = GetBasketgroup($basketgroupid);
44
$basketgroup = GetBasketgroup($basketgroupid);
43
ok($basketgroup->{closed}, "basket group is closed");
45
ok($basketgroup->{closed}, "basket group is closed");
44
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
46
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
45
is($basketgroup->{closeddate}, sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day), "basket group closed date is correct");
47
is($basketgroup->{closeddate}, $today->ymd, "basket group closed date is correct");
46
48
47
$basketgroupid = NewBasketgroup({
49
$basketgroupid = NewBasketgroup({
48
    booksellerid => $booksellerid,
50
    booksellerid => $booksellerid,
Lines 52-57 $basketgroupid = NewBasketgroup({ Link Here
52
$basketgroup = GetBasketgroup($basketgroupid);
54
$basketgroup = GetBasketgroup($basketgroupid);
53
ok($basketgroup->{closed}, "basket group is closed");
55
ok($basketgroup->{closed}, "basket group is closed");
54
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
56
ok(defined($basketgroup->{closeddate}), "basket group closed date is not empty");
55
is($basketgroup->{closeddate}, sprintf("%04d-%02d-%02d", $year+1900, $month+1, $day), "basket group closed date is correct");
57
is($basketgroup->{closeddate}, $today->ymd, "basket group closed date is correct");
56
58
57
$dbh->rollback;
59
$dbh->rollback;
58
- 

Return to bug 11708