aboutsummaryrefslogtreecommitdiffstats
path: root/tests/migrator
diff options
context:
space:
mode:
authorPayBas <contact@paybas.com>2014-05-23 22:24:57 +0200
committerPayBas <contact@paybas.com>2014-05-24 14:37:08 +0200
commit05839f85994c1281936d2dd64215c068e55b6d54 (patch)
tree7b064c60d89add2b23593d91a851e3e3237ccac9 /tests/migrator
parent9ddf02243e37adb27984ef34e208943a413266b8 (diff)
downloadforums-05839f85994c1281936d2dd64215c068e55b6d54.tar
forums-05839f85994c1281936d2dd64215c068e55b6d54.tar.gz
forums-05839f85994c1281936d2dd64215c068e55b6d54.tar.bz2
forums-05839f85994c1281936d2dd64215c068e55b6d54.tar.xz
forums-05839f85994c1281936d2dd64215c068e55b6d54.zip
[ticket/12561] Added test for "after"
PHPBB3-12561
Diffstat (limited to 'tests/migrator')
-rw-r--r--tests/migrator/schema_generator_test.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php
index 4bac447229..4de6064895 100644
--- a/tests/migrator/schema_generator_test.php
+++ b/tests/migrator/schema_generator_test.php
@@ -7,6 +7,8 @@
*
*/
+require_once __DIR__ . '/../dbal/migration/dummy_order.php';
+
class schmema_generator_test extends phpbb_test_case
{
public function setUp()
@@ -46,4 +48,19 @@ class schmema_generator_test extends phpbb_test_case
$this->assertArrayHasKey('phpbb_users', $this->generator->get_schema());
}
+
+ public function test_check_column_position_success()
+ {
+ $this->get_schema_generator(array(
+ 'phpbb_dbal_migration_dummy_order',
+ ));
+
+ $tables = $this->generator->get_schema();
+ $columns = $tables[$this->table_prefix . 'column_order_test']['COLUMNS'];
+
+ $offset1 = array_search('foobar1', array_keys($columns));
+ $offset2 = array_search('foobar2', array_keys($columns));
+
+ $this->assertEquals($offset1 + 1, $offset2, 'The schema generator could not position the column correctly, using the "after" option in the migration script.');
+ }
}