DropTest.php 930 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Medoo\Tests;
  3. use Medoo\Medoo;
  4. /**
  5. * @coversDefaultClass \Medoo\Medoo
  6. */
  7. class DropTest extends MedooTestCase
  8. {
  9. /**
  10. * @covers ::drop()
  11. * @dataProvider typesProvider
  12. */
  13. public function testDrop($type)
  14. {
  15. $this->setType($type);
  16. $this->database->drop("account");
  17. $this->assertQuery(
  18. <<<EOD
  19. DROP TABLE IF EXISTS "account"
  20. EOD,
  21. $this->database->queryString
  22. );
  23. }
  24. /**
  25. * @covers ::drop()
  26. */
  27. public function testDropWithPrefix()
  28. {
  29. $database = new Medoo([
  30. 'testMode' => true,
  31. 'prefix' => 'PREFIX_'
  32. ]);
  33. $database->type = "sqlite";
  34. $database->drop("account");
  35. $this->assertQuery(
  36. <<<EOD
  37. DROP TABLE IF EXISTS "PREFIX_account"
  38. EOD,
  39. $database->queryString
  40. );
  41. }
  42. }