2009-05-28 06:04:51 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\DBAL\Functional\Schema;
|
|
|
|
|
|
|
|
use Doctrine\DBAL\Schema;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../../../TestInit.php';
|
|
|
|
|
2009-06-15 22:25:47 +04:00
|
|
|
class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
|
2009-05-28 06:04:51 +04:00
|
|
|
{
|
2009-06-15 22:25:47 +04:00
|
|
|
/**
|
2009-11-03 19:56:05 +03:00
|
|
|
* SQLITE does not support databases.
|
|
|
|
*
|
2009-06-15 22:25:47 +04:00
|
|
|
* @expectedException \Exception
|
|
|
|
*/
|
2009-05-28 06:04:51 +04:00
|
|
|
public function testListDatabases()
|
|
|
|
{
|
2009-06-15 22:25:47 +04:00
|
|
|
$this->_sm->listDatabases();
|
2009-05-28 06:04:51 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testCreateAndDropDatabase()
|
|
|
|
{
|
|
|
|
$path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite';
|
|
|
|
|
2009-06-20 21:02:02 +04:00
|
|
|
$this->_sm->createDatabase($path);
|
2009-05-29 01:34:35 +04:00
|
|
|
$this->assertEquals(true, file_exists($path));
|
2009-06-20 21:02:02 +04:00
|
|
|
$this->_sm->dropDatabase($path);
|
2009-05-29 01:34:35 +04:00
|
|
|
$this->assertEquals(false, file_exists($path));
|
2009-06-20 21:02:02 +04:00
|
|
|
}
|
2009-05-28 06:04:51 +04:00
|
|
|
|
2009-06-15 22:25:47 +04:00
|
|
|
/**
|
|
|
|
* @expectedException \Exception
|
|
|
|
*/
|
2009-12-18 15:30:19 +03:00
|
|
|
// This test is not correct. createSequence expects an object.
|
|
|
|
// PHPUnit wrapping the PHP error in an exception hides this but it shows up
|
|
|
|
// when the tests are run in the build (phing).
|
|
|
|
/*public function testCreateSequence()
|
2009-05-28 06:04:51 +04:00
|
|
|
{
|
2009-06-15 22:25:47 +04:00
|
|
|
$this->_sm->createSequence('seqname', 1, 1);
|
2009-12-18 15:30:19 +03:00
|
|
|
}*/
|
2009-06-20 21:02:02 +04:00
|
|
|
|
2009-06-15 22:25:47 +04:00
|
|
|
/**
|
|
|
|
* @expectedException \Exception
|
|
|
|
*/
|
2009-12-18 15:30:19 +03:00
|
|
|
// This test is not correct. createForeignKey expects an object.
|
|
|
|
// PHPUnit wrapping the PHP error in an exception hides this but it shows up
|
|
|
|
// when the tests are run in the build (phing).
|
|
|
|
/*public function testCreateForeignKey()
|
2009-05-28 06:04:51 +04:00
|
|
|
{
|
2009-06-15 22:25:47 +04:00
|
|
|
$this->_sm->createForeignKey('table', array());
|
2009-12-18 15:30:19 +03:00
|
|
|
}*/
|
2009-05-28 06:04:51 +04:00
|
|
|
|
2009-06-15 22:25:47 +04:00
|
|
|
/**
|
|
|
|
* @expectedException \Exception
|
|
|
|
*/
|
2009-05-28 06:04:51 +04:00
|
|
|
public function testRenameTable()
|
|
|
|
{
|
2009-06-15 22:25:47 +04:00
|
|
|
$this->_sm->renameTable('oldname', 'newname');
|
2009-05-28 06:04:51 +04:00
|
|
|
}
|
|
|
|
}
|