public function testRelationshipGeneration() {
Connections::add('mock-source', $this->_testConfig);
$from = 'lithium\tests\mocks\data\MockComment';
$to = 'lithium\tests\mocks\data\MockPost';
$from::config(array('connection' => 'mock-source'));
$to::config(array('connection' => 'mock-source', 'key' => '_id'));
$result = $this->db->relationship($from, 'belongsTo', 'MockPost');
$expected = array(
'name' => 'MockPost',
'type' => 'belongsTo',
'key' => array('mockComment' => '_id'),
'from' => $from,
'link' => 'contained',
'to' => $to,
'fields' => true,
'fieldName' => 'mockPost',
'constraint' => null,
'init' => true
);
$this->assertEqual($expected, $result->data());
Connections::config(array('mock-source' => false));
}