MigrationTestCase.php 765 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Doctrine\DBAL\Migrations\Tests;
  3. use Doctrine\Common\ClassLoader;
  4. use Doctrine\DBAL\DriverManager;
  5. abstract class MigrationTestCase extends \PHPUnit_Framework_TestCase
  6. {
  7. public function getSqliteConnection()
  8. {
  9. $params = array('driver' => 'pdo_sqlite', 'memory' => true);
  10. return DriverManager::getConnection($params);
  11. }
  12. /**
  13. * @return \Doctrine\DBAL\Migrations\Configuration\Configuration
  14. */
  15. public function getSqliteConfiguration()
  16. {
  17. $config = new \Doctrine\DBAL\Migrations\Configuration\Configuration($this->getSqliteConnection());
  18. $config->setMigrationsDirectory(\sys_get_temp_dir());
  19. $config->setMigrationsNamespace('DoctrineMigrations');
  20. return $config;
  21. }
  22. }