Esempio n. 1
0
 public function testGroupByClassJoinedModelWithAlias()
 {
     $c = new ModelCriteria('bookstore', 'Author');
     $c->join('Author.Book b');
     $c->groupByClass('b');
     $sql = 'SELECT  FROM `author` INNER JOIN `book` `b` ON (author.ID=b.AUTHOR_ID) GROUP BY b.ID,b.TITLE,b.ISBN,b.PRICE,b.PUBLISHER_ID,b.AUTHOR_ID';
     $params = array();
     $this->assertCriteriaTranslation($c, $sql, $params, 'groupByClass() accepts the alias of a joined model');
 }
 public function testGroupByClassJoinedModelWithAlias()
 {
     $c = new ModelCriteria('bookstore', 'Author');
     $c->join('Author.Book b');
     $c->groupByClass('b');
     $sql = 'SELECT  FROM `author` INNER JOIN `book` `b` ON (author.id=b.author_id) GROUP BY b.id,b.title,b.isbn,b.price,b.publisher_id,b.author_id';
     $params = array();
     $this->assertCriteriaTranslation($c, $sql, $params, 'groupByClass() accepts the alias of a joined model');
 }