From a71ceb222d623c3492f235f80817fc6ecc85027a Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 25 Feb 2020 13:40:52 +0000 Subject: [PATCH] Bug 24294: (QA follow-up) Add rollback and 008 default test Default for 008 was not tested yet. Only wondering if we should insert default values only when we meet an undefined value. Or should we also add if we meet an empty string? Is the latter not more realistic in MARC? Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 9056d53e32667ae997516a00586c02f567cb948a) Signed-off-by: Lucas Gass --- t/db_dependent/Acquisition/FillWithDefaultValues.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Acquisition/FillWithDefaultValues.t b/t/db_dependent/Acquisition/FillWithDefaultValues.t index 8a09fdaf66..0bba1be9dc 100755 --- a/t/db_dependent/Acquisition/FillWithDefaultValues.t +++ b/t/db_dependent/Acquisition/FillWithDefaultValues.t @@ -1,5 +1,5 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 6; use Test::MockModule; use MARC::Record; @@ -90,3 +90,10 @@ is_deeply( [ [ 'x', $default_x ] ], '099$x contains the default value' ); + +# Test controlfield default +$record->field('008')->update( undef ); +C4::Acquisition::FillWithDefaultValues($record); +is( $record->field('008')->data, $default_x, 'Controlfield got default' ); + +$schema->storage->txn_rollback; -- 2.20.1