public function canLoadRecordTreeFromDatabase()
{
$record = $this->getBasicRecord();
$provider = $this->getMock(str_replace('Tests\\Unit\\', '', substr(get_class($this), 0, -4)), array('loadRecordFromDatabase', 'getParentFieldName', 'getParentFieldValue'));
$provider->expects($this->exactly(2))->method('getParentFieldName')->will($this->returnValue('somefield'));
$provider->expects($this->exactly(1))->method('getParentFieldValue')->will($this->returnValue(1));
$provider->expects($this->exactly(1))->method('loadRecordFromDatabase')->will($this->returnValue($record));
$output = $this->callInaccessibleMethod($provider, 'loadRecordTreeFromDatabase', $record);
$expected = array($record);
$this->assertEquals($expected, $output);
}