@@ -9,14 +9,17 @@ class MigrateTest extends PHPUnit_Framework_TestCase
99 private static $ db ;
1010 private static $ dbName ;
1111 private static $ migrationPath ;
12+ private static $ changelog ;
1213
1314 public static function setUpBeforeClass () {
1415 self ::$ dbName = dirname (__FILE__ ) . '/test.sqlite ' ;
1516 unlink (self ::$ dbName );
17+
18+ self ::$ changelog = 'mychangelog ' ;
1619
1720 self ::$ db = new PDO ('sqlite: ' . self ::$ dbName , '' , '' );
1821 self ::$ db ->setAttribute (PDO ::ATTR_ERRMODE , PDO ::ERRMODE_EXCEPTION );
19- self ::$ db ->exec ("create table changelog (
22+ self ::$ db ->exec ("create table " . self :: $ changelog . " (
2023 id numeric(20,0),
2124 applied_at character varying(25),
2225 version character varying(25),
@@ -56,9 +59,9 @@ public function testGetLocaleList() {
5659 * @Test
5760 */
5861 public function testGetDbList () {
59- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100101, '2010-01-01', 'description 1') " );
60- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100102, '2010-01-02', 'description 2') " );
61- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100103, '2010-01-03', 'description 3') " );
62+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100101, '2010-01-01', 'description 1') " );
63+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100102, '2010-01-02', 'description 2') " );
64+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100103, '2010-01-03', 'description 3') " );
6265
6366 $ expected = array (
6467 '20100101 ' => new Migration ('20100101 ' , '2010-01-01 ' , 'description 1 ' , '20100101_description_1.sql ' , true ),
@@ -71,7 +74,7 @@ public function testGetDbList() {
7174
7275 $ migrationList = $ migrator ->getDbList ();
7376
74- self ::$ db ->query ("DELETE FROM changelog " );
77+ self ::$ db ->query ("DELETE FROM " . self :: $ changelog );
7578
7679 $ this ->assertEquals ($ expected , $ migrationList );
7780
@@ -90,10 +93,10 @@ public function testGetMigrationList() {
9093 touch (self ::$ migrationPath . "/20100104_description_2.sql " );
9194 touch (self ::$ migrationPath . "/20100105_description_3.sql " );
9295
93- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100100, '2009-12-30', 'description 0') " );
94- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100103, '2010-01-01', 'description 1') " );
95- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100104, '2010-01-02', 'description 2') " );
96- self ::$ db ->query ("INSERT INTO changelog (id, applied_at, description) VALUES (20100105, '2010-01-03', 'description 3') " );
96+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100100, '2009-12-30', 'description 0') " );
97+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100103, '2010-01-01', 'description 1') " );
98+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100104, '2010-01-02', 'description 2') " );
99+ self ::$ db ->query ("INSERT INTO " . self :: $ changelog . " (id, applied_at, description) VALUES (20100105, '2010-01-03', 'description 3') " );
97100
98101 $ expected = array (
99102 '20100100 ' => new Migration ('20100100 ' , '2009-12-30 ' , 'description 0 ' , '20100100_description_0.sql ' , true ),
@@ -108,7 +111,7 @@ public function testGetMigrationList() {
108111 $ migrator ->setDb (self ::$ db );
109112 $ migrationList = $ migrator ->getMigrationList ();
110113
111- self ::$ db ->query ("DELETE FROM changelog " );
114+ self ::$ db ->query ("DELETE FROM " . self :: $ changelog );
112115
113116 unlink (self ::$ migrationPath . "/20100101_add_table_1.sql " );
114117 unlink (self ::$ migrationPath . "/20100102_add_table_2.sql " );
0 commit comments