public function testObjectItemArray()
{
$xml = '
<object id="Item">
<label>title</label>
<table>test_item</table>
<labelField>title</labelField>
<nested>false</nested>
<multiLanguage>false</multiLanguage>
<workspace>true</workspace>
<domainDepended>false</domainDepended>
<treeFixedIcon>false</treeFixedIcon>
<fields>
<field id="id" type="number" primaryKey="true" autoIncrement="true">
</field>
<field id="title" type="text">
</field>
<field id="category" type="object">
<object>test/itemCategory</object>
<objectRelation>nToM</objectRelation>
</field>
<field id="oneCategory" type="object">
<object>test/itemCategory</object>
<objectRelation>nTo1</objectRelation>
</field>
</fields>
</object>';
$object = new Object($xml, $this->getJarves());
$array = $object->toArray();
$this->assertEquals('Item', $object->getId());
$this->assertEquals('title', $object->getLabel());
$this->assertEquals('test_item', $object->getTable());
$this->assertTrue($object->getWorkspace());
$this->assertCount(4, $object->getFields());
$this->assertEquals('Item', $array['id']);
$this->assertEquals('title', $array['label']);
$this->assertEquals('test_item', $array['table']);
$this->assertTrue($array['workspace']);
$this->assertCount(4, $array['fields']);
}