Bug 14639: (regression tests) Extend Koha::MetadataRecord to handle serialization...
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 3 Aug 2015 14:37:36 +0000 (11:37 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 7 Sep 2015 15:06:21 +0000 (12:06 -0300)
commit7587e7c752fc33788416e351e15154cf843fe18c
treec537dd8d926fb863984a95b1aab9591345cd8679
parente2a87c54c0c7d26d131e0bff147d6bab1bcaa792
Bug 14639: (regression tests) Extend Koha::MetadataRecord to handle serialization format and record id

In order to use Koha::MetadataRecord as a container for moving records
around it is important to let it carry the serialization format
of the record object it was built with, so it is easier and cheaper to
make decisions about records.

This patch introduces regression tests for the changes to be made.
The 'format' param is introduced, and also sets default values:
  schema => 'marc21'
  format => 'MARC'

A new (optional) 'id' param is added so the record carries its own id outside
of it.

The default behaviour is preserved, and no changes are needed in places
Koha::MetadataRecord is used.
->new also returns undef if no record is passed, and raises a carped warning.

To test:
- Apply this test patch
- Run the new tests
  $ prove t/Koha_MetadataRecord.t
=> FAIL: Tests shoud fail as the changes are not implemented on Koha::MetadataRecord

Edit: made serialization format be upper-case to match what is used on Koha::Filter's

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
t/Koha_MetadataRecord.t