SqliteSchemaManagerTest.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Doctrine\Tests\DBAL\Functional\Schema;
  3. use Doctrine\DBAL\Schema;
  4. require_once __DIR__ . '/../../../TestInit.php';
  5. class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
  6. {
  7. /**
  8. * SQLITE does not support databases.
  9. *
  10. * @expectedException \Exception
  11. */
  12. public function testListDatabases()
  13. {
  14. $this->_sm->listDatabases();
  15. }
  16. public function testCreateAndDropDatabase()
  17. {
  18. $path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite';
  19. $this->_sm->createDatabase($path);
  20. $this->assertEquals(true, file_exists($path));
  21. $this->_sm->dropDatabase($path);
  22. $this->assertEquals(false, file_exists($path));
  23. }
  24. /**
  25. * @expectedException \Exception
  26. */
  27. // This test is not correct. createSequence expects an object.
  28. // PHPUnit wrapping the PHP error in an exception hides this but it shows up
  29. // when the tests are run in the build (phing).
  30. /*public function testCreateSequence()
  31. {
  32. $this->_sm->createSequence('seqname', 1, 1);
  33. }*/
  34. /**
  35. * @expectedException \Exception
  36. */
  37. // This test is not correct. createForeignKey expects an object.
  38. // PHPUnit wrapping the PHP error in an exception hides this but it shows up
  39. // when the tests are run in the build (phing).
  40. /*public function testCreateForeignKey()
  41. {
  42. $this->_sm->createForeignKey('table', array());
  43. }*/
  44. /**
  45. * @expectedException \Exception
  46. */
  47. public function testRenameTable()
  48. {
  49. $this->_sm->renameTable('oldname', 'newname');
  50. }
  51. }