Re: [Koha-devel] Perl advice for checking hash content

2021-08-30 Thread Victor Grousset/tuxayo
On 21-08-30 11:07, Jonathan Druart wrote: Keep it simple, why not the following? Because I didn't think of it :O Thanks a lot, tests fixed! Cheers, -- Victor Grousset/tuxayo ___ Koha-devel mailing list Koha-devel@lists.koha-community.org https://lis

Re: [Koha-devel] Perl advice for checking hash content

2021-08-30 Thread Jonathan Druart
Keep it simple, why not the following? my $canbe = CanItemBeReserved( $patron->borrowernumber, $itemnumber ); is_deeply( [$canbe->{status}, $canbe->{limit}] ['tooManyReservesToday', 0], 'Patron cannot reserve if holds_per_day is 0 (i.e. 0 is 0)' ); Le sam. 28 août 2021 à 09:38, Vic

[Koha-devel] Perl advice for checking hash content

2021-08-28 Thread Victor Grousset/tuxayo
Hi :) For a development, I'm adding additional keys to C4::Reserves::CanItemBeReserved returned hash. But there are a bunch of tests that match the whole return value and thus don't expect the new keys in the hash. Here is the best way so far I've found to adapt it. is_deeply( CanItem