| @@ 8-33 (lines=26) @@ | ||
| 5 | /** |
|
| 6 | * @requires extension pdo_mysql |
|
| 7 | */ |
|
| 8 | class MysqlDatabaseTest extends BaseDatabase |
|
| 9 | { |
|
| 10 | protected $uri = 'mysql://root:password@mysql-container/migratedatabase'; |
|
| 11 | ||
| 12 | /** |
|
| 13 | * @var \ByJG\DbMigration\Migration |
|
| 14 | */ |
|
| 15 | protected $migrate = null; |
|
| 16 | ||
| 17 | public function setUp() |
|
| 18 | { |
|
| 19 | $this->migrate = new \ByJG\DbMigration\Migration(new \ByJG\Util\Uri($this->uri), __DIR__ . '/../example/mysql'); |
|
| 20 | $this->migrate->registerDatabase("mysql", \ByJG\DbMigration\Database\MySqlDatabase::class); |
|
| 21 | parent::setUp(); |
|
| 22 | } |
|
| 23 | ||
| 24 | public function testUsingCustomTable() |
|
| 25 | { |
|
| 26 | $this->migrationTable = 'migration_table'; |
|
| 27 | ||
| 28 | $this->migrate = new \ByJG\DbMigration\Migration(new \ByJG\Util\Uri($this->uri), __DIR__ . '/../example/mysql', true, $this->migrationTable); |
|
| 29 | $this->migrate->registerDatabase("mysql", \ByJG\DbMigration\Database\MySqlDatabase::class); |
|
| 30 | ||
| 31 | parent::testUpVersion1(); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| @@ 9-34 (lines=26) @@ | ||
| 6 | /** |
|
| 7 | * @requires extension pdo_pgsql |
|
| 8 | */ |
|
| 9 | class PostgresDatabaseTest extends BaseDatabase |
|
| 10 | { |
|
| 11 | protected $uri = 'pgsql://postgres:password@postgres-container/migratedatabase'; |
|
| 12 | ||
| 13 | /** |
|
| 14 | * @var \ByJG\DbMigration\Migration |
|
| 15 | */ |
|
| 16 | protected $migrate = null; |
|
| 17 | ||
| 18 | public function setUp() |
|
| 19 | { |
|
| 20 | $this->migrate = new \ByJG\DbMigration\Migration(new \ByJG\Util\Uri($this->uri), __DIR__ . '/../example/postgres'); |
|
| 21 | $this->migrate->registerDatabase("pgsql", \ByJG\DbMigration\Database\PgsqlDatabase::class); |
|
| 22 | parent::setUp(); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function testUsingCustomTable() |
|
| 26 | { |
|
| 27 | $this->migrationTable = 'migration_table'; |
|
| 28 | ||
| 29 | $this->migrate = new \ByJG\DbMigration\Migration(new \ByJG\Util\Uri($this->uri), __DIR__ . '/../example/postgres', true, $this->migrationTable); |
|
| 30 | $this->migrate->registerDatabase("pgsql", \ByJG\DbMigration\Database\PgsqlDatabase::class); |
|
| 31 | ||
| 32 | parent::testUpVersion1(); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||