Lines 1-5
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
use Test::More tests => 17; |
2 |
use Test::More tests => 18; |
3 |
|
3 |
|
4 |
use C4::Acquisition; |
4 |
use C4::Acquisition; |
5 |
use C4::Budgets qw( AddBudgetPeriod AddBudget ); |
5 |
use C4::Budgets qw( AddBudgetPeriod AddBudget ); |
Lines 162-164
is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' );
Link Here
|
162 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
162 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
163 |
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format! |
163 |
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format! |
164 |
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' ); |
164 |
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' ); |
165 |
- |
165 |
|
|
|
166 |
subtest 'prevent SQL injections' => sub { |
167 |
plan tests => 1; |
168 |
my $time1 = time; |
169 |
my $hack = q|1 OR (SELECT 1 FROM (SELECT(SLEEP(10)))x)-- -|; |
170 |
GetLateOrMissingIssues($hack); |
171 |
my $time2 = time; |
172 |
ok( $time2 < $time1 + 10, 'The sleep should not be executed' ); |
173 |
}; |