/** * @test */ public function itShouldWriteDeleteRowWithWhereConditionAndLimit1() { $this->query->setTable('user'); $conditions = $this->query->where(); $conditions->equals('user_id', 10)->equals('user_id', 20)->equals('user_id', 30); $this->query->limit(1); $expected = <<<SQL DELETE FROM user WHERE (user.user_id = :v1) AND (user.user_id = :v2) AND (user.user_id = :v3) LIMIT :v4 SQL; $this->assertSame($expected, $this->writer->write($this->query)); $expected = array(':v1' => 10, ':v2' => 20, ':v3' => 30, ':v4' => 1); $this->assertEquals($expected, $this->writer->getValues()); }
/** * @test */ public function itShouldReturnLimit1() { $this->query->limit(1); $this->assertSame(1, $this->query->getLimitStart()); }