/** * @test */ public function shouldCreateSelectCountQuery() { // when $query = Query::count(); // then $this->assertEquals(QueryType::$COUNT, $query->type); }
/** * @test */ public function shouldIgnoreOrderLimitAndOffsetForSelectCount() { // given $query = Query::count()->table('products')->order('name desc')->limit(1)->offset(10); // when $sql = $this->dialect->buildQuery($query); // then $this->assertEquals('SELECT count(*) FROM products', $sql); }