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

(-)a/t/db_dependent/Acquisition/NewOrder.t (-2 / +6 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 7;
5
use Test::More tests => 8;
6
use C4::Acquisition;
6
use C4::Acquisition;
7
use C4::Biblio;
7
use C4::Biblio;
8
use C4::Budgets;
8
use C4::Budgets;
Lines 17-22 $schema->storage->txn_begin(); Link Here
17
my $dbh = C4::Context->dbh;
17
my $dbh = C4::Context->dbh;
18
$dbh->{RaiseError} = 1;
18
$dbh->{RaiseError} = 1;
19
19
20
C4::Context->_new_userenv('xxx');
21
C4::Context->set_userenv(42, 'ordercreator', '0042', 'Order', 'Creator', 'CPL',
22
    0, 'ordercreator@example.com');
23
20
my $bookseller = Koha::Acquisition::Bookseller->new(
24
my $bookseller = Koha::Acquisition::Bookseller->new(
21
    {
25
    {
22
        name => "my vendor",
26
        name => "my vendor",
Lines 86-90 my $ordernumber = $order->{ordernumber}; Link Here
86
$order = Koha::Acquisition::Order->fetch({ ordernumber => $ordernumber });
90
$order = Koha::Acquisition::Order->fetch({ ordernumber => $ordernumber });
87
is( $order->{quantityreceived}, 0, 'Koha::Acquisition::Order->insert set quantityreceivedto 0 if undef is given' );
91
is( $order->{quantityreceived}, 0, 'Koha::Acquisition::Order->insert set quantityreceivedto 0 if undef is given' );
88
is( $order->{entrydate}, output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 'Koha::Acquisition::Order->insert set entrydate to today' );
92
is( $order->{entrydate}, output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), 'Koha::Acquisition::Order->insert set entrydate to today' );
93
is( $order->{created_by}, 42, 'Koha::Acquisition::Order->insert set created_by to logged in user if not given' );
89
94
90
$schema->storage->txn_rollback();
95
$schema->storage->txn_rollback();
91
- 

Return to bug 12395