Bug 15578: Make sure all params will be taken into account when instantiating

The tests in t/db_dependent/Koha_Authority.t expects at least 1
authority record in the DB to run them, otherwise they are skipped.
On our integration server, the DB does not contain any records, and the
tests are skipped.
Unfortunately these tests were testing the authid method of
Koha::MetadataRecord::Authority.

Test plan:
Apply the first patch, launch tests
=> Fail
Apply the second patch, launch tests
=> \o/

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Test pass successfuly

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
This commit is contained in:
Jonathan Druart 2016-01-14 12:27:55 +00:00 committed by Brendan Gallagher
parent 538320123d
commit 3430e554ca
1 changed files with 2 additions and 11 deletions

View File

@ -87,17 +87,8 @@ sub new {
return;
}
my $record = $params->{ record };
my $schema = $params->{ schema };
my $format = $params->{ format } // 'MARC';
my $id = $params->{ id };
my $self = $class->SUPER::new({
record => $record,
schema => $schema,
format => $format,
id => $id
});
$params->{format} //= 'MARC';
my $self = $class->SUPER::new($params);
bless $self, $class;
return $self;