Skip to content
Snippets Groups Projects
Commit a5704b83 authored by David Maus's avatar David Maus
Browse files

Add unit test for serialization

parent 816565ac
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,25 @@ class RecordTest extends PHPUnit_FrameWork_TestCase
$this->assertInstanceOf('HAB\Pica\Record\Field', $record->getFirstMatchingField('001@'));
}
public function testSerialization ()
{
$record = Record::factory(
array('fields' =>
array(
array('tag' => '002@',
'occurrence' => 0,
'subfields' => array(array('code' => '0', 'value' => 'T'))),
array('tag' => '003@',
'occurrence' => 0,
'subfields' => array(array('code' => '0', 'value' => '123456789X')))
)
)
);
$data = serialize($record);
$record = unserialize($data);
$this->assertCount(2, $record->getFields());
}
///
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment