From 6dceec4ca93f08d687694d38e0dcc8150b495615 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 Content-Type: text/plain; charset=utf-8 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 --- 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.11.0