Bug 34435: Add unit test
To test: prove t/db_dependent/Koha/Patron/Category.t Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commit4203632582) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commitef24af8da3) Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
This commit is contained in:
parent
fc3fde11d4
commit
77f55baa51
|
|
@ -206,7 +206,7 @@ subtest 'effective_require_strong_password' => sub {
|
|||
|
||||
subtest 'get_password_expiry_date() tests' => sub {
|
||||
|
||||
plan tests => 2;
|
||||
plan tests => 3;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
|
|
@ -218,6 +218,14 @@ subtest 'get_password_expiry_date() tests' => sub {
|
|||
$category->password_expiry_days( 32 )->store;
|
||||
is( $category->get_password_expiry_date(), dt_from_string()->add( days => 32 )->ymd, "Date correctly calculated from password_expiry_days when set");
|
||||
|
||||
my $dt = dt_from_string;
|
||||
my $original_dt = $dt->clone;
|
||||
$category->get_password_expiry_date($dt);
|
||||
is(
|
||||
$dt->ymd, $original_dt->ymd,
|
||||
'DateTime object passed as a parameter should not be modified when ->get_password_expiry_date is called'
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
subtest 'can_make_suggestions' => sub {
|
||||
|
|
|
|||
Loading…
Reference in New Issue