DeleteTest.php 646 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Medoo\Tests;
  3. /**
  4. * @coversDefaultClass \Medoo\Medoo
  5. */
  6. class DeleteTest extends MedooTestCase
  7. {
  8. /**
  9. * @covers ::delete()
  10. * @dataProvider typesProvider
  11. */
  12. public function testDelete($type)
  13. {
  14. $this->setType($type);
  15. $this->database->delete("account", [
  16. "AND" => [
  17. "type" => "business",
  18. "age[<]" => 18
  19. ]
  20. ]);
  21. $this->assertQuery(
  22. <<<EOD
  23. DELETE FROM "account"
  24. WHERE ("type" = 'business' AND "age" < 18)
  25. EOD,
  26. $this->database->queryString
  27. );
  28. }
  29. }