/**
* tests parsing an not empty data collection with children
*
* @group data
* @group sourcetest
*/
public function testParseOnNotEmptyDatacollectionWithChildren()
{
$mockCollection = $this->getMock('\\Browscap\\Data\\DataCollection', array('getDivisions', 'getDefaultProperties'), array(), '', false);
$mockCollection->expects(self::never())->method('getDivisions')->will(self::returnValue(array()));
$mockDivision = $this->getMock('\\Browscap\\Data\\Division', array('getUserAgents'), array(), '', false);
$mockDivision->expects(self::once())->method('getUserAgents')->will(self::returnValue(array(0 => array('properties' => array('avd' => 'xyz')))));
$mockCollection->expects(self::once())->method('getDefaultProperties')->will(self::returnValue($mockDivision));
$uaData = array(0 => array('userAgent' => 'abc', 'properties' => array('Parent' => 'Defaultproperties', 'Version' => '1.0', 'MajorVer' => 1, 'Browser' => 'xyz'), 'children' => array(0 => array('match' => 'abc*', 'properties' => array('Browser' => 'xyza')))));
$mockDivision = $this->getMock('\\Browscap\\Data\\Division', array('getUserAgents'), array(), '', false);
$mockDivision->expects(self::once())->method('getUserAgents')->will(self::returnValue($uaData));
$this->object->setLogger($this->logger);
self::assertSame($this->object, $this->object->setDataCollection($mockCollection));
$result = $this->object->expand($mockDivision, 'TestDivision');
self::assertInternalType('array', $result);
self::assertCount(2, $result);
}