v1.1
This commit is contained in:
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Medoo\Tests;
|
||||
|
||||
use Medoo\Medoo;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Medoo\Medoo
|
||||
*/
|
||||
class DropTest extends MedooTestCase
|
||||
{
|
||||
/**
|
||||
* @covers ::drop()
|
||||
* @dataProvider typesProvider
|
||||
*/
|
||||
public function testDrop($type)
|
||||
{
|
||||
$this->setType($type);
|
||||
|
||||
$this->database->drop("account");
|
||||
|
||||
$this->assertQuery(
|
||||
<<<EOD
|
||||
DROP TABLE IF EXISTS "account"
|
||||
EOD,
|
||||
$this->database->queryString
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::drop()
|
||||
*/
|
||||
public function testDropWithPrefix()
|
||||
{
|
||||
$database = new Medoo([
|
||||
'testMode' => true,
|
||||
'prefix' => 'PREFIX_'
|
||||
]);
|
||||
|
||||
$database->type = "sqlite";
|
||||
|
||||
$database->drop("account");
|
||||
|
||||
$this->assertQuery(
|
||||
<<<EOD
|
||||
DROP TABLE IF EXISTS "PREFIX_account"
|
||||
EOD,
|
||||
$database->queryString
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user