public function testJoinsOnModelWithAssociationAndExplicitJoins() { JoinBook::$belongsTo = array(array('author')); JoinBook::first(array('joins' => array('author', 'LEFT JOIN authors a ON(books.secondary_author_id=a.author_id)'))); $this->assertSqlHas('INNER JOIN authors ON(books.author_id = authors.author_id)', JoinBook::table()->lastSql); $this->assertSqlHas('LEFT JOIN authors a ON(books.secondary_author_id=a.author_id)', JoinBook::table()->lastSql); }