diff --git a/tests/Dbal/Other/UpdateTest.php b/tests/Dbal/Other/UpdateTest.php index 6a04955..376a872 100644 --- a/tests/Dbal/Other/UpdateTest.php +++ b/tests/Dbal/Other/UpdateTest.php @@ -4,6 +4,7 @@ use Mockery as m; use ORM\Dbal\Other; +use ORM\QueryBuilder\QueryBuilder; use ORM\Test\TestCase; class UpdateTest extends TestCase @@ -35,4 +36,14 @@ public function updatesEscapedValues() $this->dbal->update('examples', ['id' => 42], ['col1' => 'hempel\'s sofa', 'col2' => 23]); } + + /** @test */ + public function doesNotNeedWhereConditions() + { + $this->pdo->shouldReceive('query')->with('UPDATE "questions" SET "answer" = 42') + ->once()->andReturn($statement = m::mock(\PDOStatement::class)); + $statement->shouldReceive('rowCount')->andReturn(1); + + $this->dbal->update('questions', [], ['answer' => 42]); + } }