|
Lines 18-24
Link Here
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
use utf8; |
19 |
use utf8; |
| 20 |
|
20 |
|
| 21 |
use Test::More tests => 57; |
21 |
use Test::More tests => 58; |
| 22 |
use Test::Exception; |
22 |
use Test::Exception; |
| 23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
| 24 |
use Test::Deep qw( cmp_deeply ); |
24 |
use Test::Deep qw( cmp_deeply ); |
|
Lines 1909-1914
subtest 'AddIssue & AllowReturnToBranch' => sub {
Link Here
|
| 1909 |
# TODO t::lib::Mocks::mock_preference('AllowReturnToBranch', 'homeorholdingbranch'); |
1909 |
# TODO t::lib::Mocks::mock_preference('AllowReturnToBranch', 'homeorholdingbranch'); |
| 1910 |
}; |
1910 |
}; |
| 1911 |
|
1911 |
|
|
|
1912 |
subtest 'AddIssue & illrequests.date_due' => sub { |
| 1913 |
plan tests => 2; |
| 1914 |
|
| 1915 |
t::lib::Mocks::mock_preference( 'ILLModule', 1 ); |
| 1916 |
my $library = $builder->build( { source => 'Branch' } ); |
| 1917 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 1918 |
my $item = $builder->build_sample_item(); |
| 1919 |
|
| 1920 |
set_userenv($library); |
| 1921 |
|
| 1922 |
my $custom_date_due = '9999-12-18 12:34:56'; |
| 1923 |
my $expected_date_due = '9999-12-18 23:59:00'; |
| 1924 |
my $illrequest = Koha::Illrequest->new({ |
| 1925 |
borrowernumber => $patron->borrowernumber, |
| 1926 |
biblio_id => $item->biblionumber, |
| 1927 |
branchcode => $library->{'branchcode'}, |
| 1928 |
date_due => $custom_date_due, |
| 1929 |
})->store; |
| 1930 |
|
| 1931 |
my $issue = AddIssue( $patron->unblessed, $item->barcode ); |
| 1932 |
is( $issue->date_due, $expected_date_due, 'Custom illrequest date due has been set for this issue'); |
| 1933 |
|
| 1934 |
$patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 1935 |
$item = $builder->build_sample_item(); |
| 1936 |
$custom_date_due = '9999-12-19'; |
| 1937 |
$expected_date_due = '9999-12-19 23:59:00'; |
| 1938 |
$illrequest = Koha::Illrequest->new({ |
| 1939 |
borrowernumber => $patron->borrowernumber, |
| 1940 |
biblio_id => $item->biblionumber, |
| 1941 |
branchcode => $library->{'branchcode'}, |
| 1942 |
date_due => $custom_date_due, |
| 1943 |
})->store; |
| 1944 |
|
| 1945 |
$issue = AddIssue( $patron->unblessed, $item->barcode ); |
| 1946 |
is( $issue->date_due, $expected_date_due, 'Custom illrequest date due has been set for this issue'); |
| 1947 |
}; |
| 1948 |
|
| 1912 |
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { |
1949 |
subtest 'CanBookBeIssued + Koha::Patron->is_debarred|has_overdues' => sub { |
| 1913 |
plan tests => 8; |
1950 |
plan tests => 8; |
| 1914 |
|
1951 |
|
| 1915 |
- |
|
|