public function testRenderArrayJoin() {
$model = 'lithium\tests\mocks\data\model\MockQueryComment';
$query = new Query(compact('model') + array(
'type' => 'read',
'source' => 'comments',
'alias' => 'Comment',
'conditions' => array('Comment.id' => 1),
'joins' => array(array(
'type' => 'INNER',
'source' => 'posts',
'alias' => 'Post',
'constraint' => array('Comment.post_id' => 'Post.id')
))
));
$expected = "SELECT * FROM {comments} AS {Comment} INNER JOIN {posts} AS {Post} ON ";
$expected .= "{Comment}.{post_id} = {Post}.{id} WHERE Comment.id = 1;";
$result = Connections::get('mock-database-connection')->renderCommand($query);
$this->assertEqual($expected, $result);
}