public function testRenderArrayJoinConstraintComplex()
{
$model = 'lithium\\tests\\mocks\\data\\model\\MockQueryComment';
$query = new Query(compact('model') + array('type' => 'read', 'source' => 'comments', 'alias' => 'Comments', 'conditions' => array('Comment.id' => 1), 'joins' => array(array('mode' => 'INNER', 'source' => 'posts', 'alias' => 'Post', 'constraints' => array('Comment.post_id' => array('<=' => 'Post.id'))))));
$expected = "SELECT * FROM {comments} AS {Comments} INNER JOIN {posts} AS {Post} ON ";
$expected .= "({Comment}.{post_id} <= {Post}.{id}) WHERE {Comment}.{id} = 1;";
$result = $this->_db->renderCommand($query);
$this->assertEqual($expected, $result);
}