aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auth/fixtures/user.xml6
-rw-r--r--tests/auth/fixtures/user_533.xml6
-rw-r--r--tests/auth/provider_apache_test.php3
-rw-r--r--tests/content_visibility/fixtures/delete_post.xml4
-rw-r--r--tests/content_visibility/fixtures/set_post_visibility.xml8
-rw-r--r--tests/content_visibility/fixtures/set_topic_visibility.xml4
-rw-r--r--tests/dbal/fixtures/massmail_crossjoin.xml8
-rw-r--r--tests/dbal/fixtures/three_users.xml8
-rw-r--r--tests/dbal/migration/schema.php44
-rw-r--r--tests/dbal/migrator_test.php25
-rw-r--r--tests/dbal/write_sequence_test.php2
-rw-r--r--tests/extension/manager_test.php3
-rw-r--r--tests/extension/metadata_manager_test.php3
-rw-r--r--tests/functional/fileupload_form_test.php22
-rw-r--r--tests/functions/fixtures/obtain_online.xml22
-rw-r--r--tests/functions/fixtures/validate_email.xml4
-rw-r--r--tests/functions/fixtures/validate_username.xml6
-rw-r--r--tests/functions_user/fixtures/group_user_attributes.xml8
-rw-r--r--tests/log/fixtures/full_log.xml6
-rw-r--r--tests/migrator/get_schema_steps_test.php200
-rw-r--r--tests/notification/fixtures/convert.xml14
-rw-r--r--tests/notification/fixtures/group_request.xml6
-rw-r--r--tests/notification/fixtures/submit_post_bookmark.xml14
-rw-r--r--tests/notification/fixtures/submit_post_post.xml14
-rw-r--r--tests/notification/fixtures/submit_post_post_in_queue.xml18
-rw-r--r--tests/notification/fixtures/submit_post_quote.xml14
-rw-r--r--tests/pagination/pagination_test.php25
-rw-r--r--tests/pagination/templates/on_page.html4
-rw-r--r--tests/pagination/templates/pagination.html3
-rw-r--r--tests/privmsgs/fixtures/delete_user_pms.xml10
-rw-r--r--tests/session/fixtures/sessions_banlist.xml4
-rw-r--r--tests/session/fixtures/sessions_empty.xml8
-rw-r--r--tests/session/fixtures/sessions_full.xml8
-rw-r--r--tests/session/fixtures/sessions_garbage.xml4
-rw-r--r--tests/session/fixtures/sessions_key.xml4
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php3
-rw-r--r--tests/user/fixtures/user_loader.xml8
37 files changed, 306 insertions, 247 deletions
diff --git a/tests/auth/fixtures/user.xml b/tests/auth/fixtures/user.xml
index 6d475930a4..77f707bab3 100644
--- a/tests/auth/fixtures/user.xml
+++ b/tests/auth/fixtures/user.xml
@@ -12,8 +12,6 @@
<column>user_login_attempts</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>foobar</value>
@@ -26,8 +24,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -41,8 +37,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/auth/fixtures/user_533.xml b/tests/auth/fixtures/user_533.xml
index c2a86ea0f9..b64f376e5b 100644
--- a/tests/auth/fixtures/user_533.xml
+++ b/tests/auth/fixtures/user_533.xml
@@ -12,8 +12,6 @@
<column>user_login_attempts</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>foobar</value>
@@ -26,8 +24,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -41,8 +37,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php
index 1231c16a4c..ac5377f2f6 100644
--- a/tests/auth/provider_apache_test.php
+++ b/tests/auth/provider_apache_test.php
@@ -193,15 +193,12 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_sig_bbcode_bitfield' => '',
- 'user_from' => '',
'user_icq' => '',
'user_aim' => '',
'user_yim' => '',
'user_msnm' => '',
'user_jabber' => '',
'user_website' => '',
- 'user_occ' => '',
- 'user_interests' => '',
'user_actkey' => '',
'user_newpasswd' => '',
'user_form_salt' => '',
diff --git a/tests/content_visibility/fixtures/delete_post.xml b/tests/content_visibility/fixtures/delete_post.xml
index deca9c74b6..c29ad23019 100644
--- a/tests/content_visibility/fixtures/delete_post.xml
+++ b/tests/content_visibility/fixtures/delete_post.xml
@@ -151,8 +151,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>4</value>
@@ -160,8 +158,6 @@
<value>user 1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/content_visibility/fixtures/set_post_visibility.xml b/tests/content_visibility/fixtures/set_post_visibility.xml
index 722525deaa..5f792d0f05 100644
--- a/tests/content_visibility/fixtures/set_post_visibility.xml
+++ b/tests/content_visibility/fixtures/set_post_visibility.xml
@@ -126,8 +126,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>1</value>
@@ -135,8 +133,6 @@
<value>user 1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -145,8 +141,6 @@
<value>user 2</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -155,8 +149,6 @@
<value>user 3</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/content_visibility/fixtures/set_topic_visibility.xml b/tests/content_visibility/fixtures/set_topic_visibility.xml
index a875012d4f..02ab5f16fe 100644
--- a/tests/content_visibility/fixtures/set_topic_visibility.xml
+++ b/tests/content_visibility/fixtures/set_topic_visibility.xml
@@ -120,8 +120,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>6</value>
@@ -129,8 +127,6 @@
<value>user 1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/dbal/fixtures/massmail_crossjoin.xml b/tests/dbal/fixtures/massmail_crossjoin.xml
index ef0a2b7149..1050ba067e 100644
--- a/tests/dbal/fixtures/massmail_crossjoin.xml
+++ b/tests/dbal/fixtures/massmail_crossjoin.xml
@@ -14,16 +14,12 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>mass email</value>
<value>mass email</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -31,8 +27,6 @@
<value>banned</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -40,8 +34,6 @@
<value>not in group</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_group">
diff --git a/tests/dbal/fixtures/three_users.xml b/tests/dbal/fixtures/three_users.xml
index a50e3e8634..a601e539e1 100644
--- a/tests/dbal/fixtures/three_users.xml
+++ b/tests/dbal/fixtures/three_users.xml
@@ -5,31 +5,23 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>barfoo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
<value>foobar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>bertie</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/dbal/migration/schema.php b/tests/dbal/migration/schema.php
new file mode 100644
index 0000000000..98407eb1bd
--- /dev/null
+++ b/tests/dbal/migration/schema.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+class phpbb_dbal_migration_schema extends \phpbb\db\migration\migration
+{
+ function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'config' => array(
+ 'test_column1' => array('BOOL', 1),
+ ),
+ ),
+ 'add_tables' => array(
+ $this->table_prefix . 'foobar' => array(
+ 'COLUMNS' => array(
+ 'module_id' => array('UINT:3', NULL, 'auto_increment'),
+ ),
+ 'PRIMARY_KEY' => 'module_id',
+ ),
+ ),
+ );
+ }
+
+ function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'config' => array(
+ 'test_column1',
+ ),
+ ),
+ 'drop_tables' => array(
+ $this->table_prefix . 'foobar',
+ ),
+ );
+ }
+}
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
index c6b4c289d3..f22f5f5b30 100644
--- a/tests/dbal/migrator_test.php
+++ b/tests/dbal/migrator_test.php
@@ -16,6 +16,7 @@ require_once dirname(__FILE__) . '/migration/revert.php';
require_once dirname(__FILE__) . '/migration/revert_with_dependency.php';
require_once dirname(__FILE__) . '/migration/fail.php';
require_once dirname(__FILE__) . '/migration/installed.php';
+require_once dirname(__FILE__) . '/migration/schema.php';
class phpbb_dbal_migrator_test extends phpbb_database_test_case
{
@@ -49,7 +50,8 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
dirname(__FILE__) . '/../../phpBB/',
'php',
'phpbb_',
- $tools
+ $tools,
+ new \phpbb\db\migration\helper()
);
$container = new phpbb_mock_container_builder();
@@ -267,4 +269,25 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->fail('Installed test failed');
}
}
+
+ public function test_schema()
+ {
+ $this->migrator->set_migrations(array('phpbb_dbal_migration_schema'));
+
+ while (!$this->migrator->finished())
+ {
+ $this->migrator->update();
+ }
+
+ $this->assertTrue($this->db_tools->sql_column_exists('phpbb_config', 'test_column1'));
+ $this->assertTrue($this->db_tools->sql_table_exists('phpbb_foobar'));
+
+ while ($this->migrator->migration_state('phpbb_dbal_migration_schema'))
+ {
+ $this->migrator->revert('phpbb_dbal_migration_schema');
+ }
+
+ $this->assertFalse($this->db_tools->sql_column_exists('phpbb_config', 'test_column1'));
+ $this->assertFalse($this->db_tools->sql_table_exists('phpbb_foobar'));
+ }
}
diff --git a/tests/dbal/write_sequence_test.php b/tests/dbal/write_sequence_test.php
index f382a971a5..5fe0fe8de9 100644
--- a/tests/dbal/write_sequence_test.php
+++ b/tests/dbal/write_sequence_test.php
@@ -42,8 +42,6 @@ class phpbb_dbal_write_sequence_test extends phpbb_database_test_case
'username_clean' => $username,
'user_permissions' => '',
'user_sig' => '',
- 'user_occ' => '',
- 'user_interests' => '',
));
$db->sql_query($sql);
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index cc32a6af4e..789dc20d14 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -106,7 +106,8 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$phpbb_root_path,
$php_ext,
$table_prefix,
- array()
+ array(),
+ new \phpbb\db\migration\helper()
);
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 592421f9e7..a3c4cc89e9 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -62,7 +62,8 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->phpbb_root_path,
'php',
$this->table_prefix,
- array()
+ array(),
+ new \phpbb\db\migration\helper()
);
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php
index ad01d7b2df..c291712c71 100644
--- a/tests/functional/fileupload_form_test.php
+++ b/tests/functional/fileupload_form_test.php
@@ -19,7 +19,6 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
parent::setUp();
$this->path = __DIR__ . '/fixtures/files/';
$this->add_lang('posting');
- $this->login();
}
public function tearDown()
@@ -63,30 +62,39 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
public function test_empty_file()
{
- $this->markTestIncomplete('Test fails intermittently.');
+ $this->login();
+
$crawler = $this->upload_file('empty.png', 'image/png');
- $this->assertEquals($this->lang('ATTACHED_IMAGE_NOT_IMAGE'), $this->assert_filter($crawler, 'div#message p')->text());
+ $this->assertEquals($this->lang('EMPTY_FILEUPLOAD'), $crawler->filter('p.error')->text());
}
public function test_invalid_extension()
{
+ $this->login();
+
$crawler = $this->upload_file('illegal-extension.bif', 'application/octet-stream');
$this->assertEquals($this->lang('DISALLOWED_EXTENSION', 'bif'), $crawler->filter('p.error')->text());
}
public function test_too_large()
{
- $this->markTestIncomplete('Functional tests use an admin account which ignores maximum upload size.');
+ $this->create_user('fileupload');
+ $this->login('fileupload');
+
$crawler = $this->upload_file('too-large.png', 'image/png');
$this->assertEquals($this->lang('WRONG_FILESIZE', '256', 'KiB'), $crawler->filter('p.error')->text());
}
public function test_valid_file()
{
- $this->markTestIncomplete('Test fails intermittently.');
+ $this->login();
+
$crawler = $this->upload_file('valid.jpg', 'image/jpeg');
- // ensure there was no error message rendered
+
+ // Ensure there was no error message rendered
$this->assertNotContains('<h2>' . $this->lang('INFORMATION') . '</h2>', $this->get_content());
- $this->assertContains($this->lang('POSTED_ATTACHMENTS'), $crawler->filter('#postform h3')->eq(1)->text());
+
+ // Also the file name should be in the first row of the files table
+ $this->assertEquals('valid.jpg', $crawler->filter('span.file-name')->eq(1)->text());
}
}
diff --git a/tests/functions/fixtures/obtain_online.xml b/tests/functions/fixtures/obtain_online.xml
index 05bbe6a05e..14621a3287 100644
--- a/tests/functions/fixtures/obtain_online.xml
+++ b/tests/functions/fixtures/obtain_online.xml
@@ -15,8 +15,6 @@
<column>user_allow_viewonline</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
@@ -24,8 +22,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -34,8 +30,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -44,8 +38,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
@@ -54,8 +46,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
@@ -64,8 +54,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
@@ -74,8 +62,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>7</value>
@@ -84,8 +70,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>8</value>
@@ -94,8 +78,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>9</value>
@@ -104,8 +86,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>10</value>
@@ -114,8 +94,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/functions/fixtures/validate_email.xml b/tests/functions/fixtures/validate_email.xml
index de7fce8a08..eb4fd90217 100644
--- a/tests/functions/fixtures/validate_email.xml
+++ b/tests/functions/fixtures/validate_email.xml
@@ -6,8 +6,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<column>user_email_hash</column>
<row>
<value>1</value>
@@ -15,8 +13,6 @@
<value>admin</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
<value>143317126117</value>
</row>
</table>
diff --git a/tests/functions/fixtures/validate_username.xml b/tests/functions/fixtures/validate_username.xml
index fbe398469c..1b85a2f06d 100644
--- a/tests/functions/fixtures/validate_username.xml
+++ b/tests/functions/fixtures/validate_username.xml
@@ -14,16 +14,12 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>admin</value>
<value>admin</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -31,8 +27,6 @@
<value>moderator</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/functions_user/fixtures/group_user_attributes.xml b/tests/functions_user/fixtures/group_user_attributes.xml
index f4edbdca49..9b1f1f504b 100644
--- a/tests/functions_user/fixtures/group_user_attributes.xml
+++ b/tests/functions_user/fixtures/group_user_attributes.xml
@@ -32,8 +32,6 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>1</value>
@@ -42,8 +40,6 @@
<value>barfoo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -53,8 +49,6 @@
<value>foobar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -64,8 +58,6 @@
<value>bertie</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_group">
diff --git a/tests/log/fixtures/full_log.xml b/tests/log/fixtures/full_log.xml
index 2ce2643d26..a10c224e0e 100644
--- a/tests/log/fixtures/full_log.xml
+++ b/tests/log/fixtures/full_log.xml
@@ -126,16 +126,12 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>Anonymous</value>
<value>Anonymous</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -143,8 +139,6 @@
<value>admin</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_topics">
diff --git a/tests/migrator/get_schema_steps_test.php b/tests/migrator/get_schema_steps_test.php
new file mode 100644
index 0000000000..226535754e
--- /dev/null
+++ b/tests/migrator/get_schema_steps_test.php
@@ -0,0 +1,200 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class get_schema_steps_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new \phpbb\db\migration\helper();
+ }
+
+ public function schema_provider()
+ {
+ return array(
+ array(
+ array(
+ 'add_tables' => array(
+ 'foo' => array(
+ 'COLUMNS' => array(
+ 'foobar' => array('BOOL', 0),
+ 'foobar2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('foobar'),
+ ),
+ 'bar' => array(
+ 'COLUMNS' => array(
+ 'barfoo' => array('BOOL', 0),
+ 'barfoor2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('barfoo'),
+ ),
+ ),
+ 'drop_tables' => array('table1', 'table2', 'table3'),
+ 'add_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ 'index2' => 'column2',
+ ),
+ 'table2' => array(
+ 'index1' => 'column1',
+ 'index2' => 'column2',
+ ),
+ ),
+ 'add_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ 'column2' => array('bar'),
+ ),
+ ),
+ 'change_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ 'column2' => array('bar'),
+ ),
+ ),
+ 'drop_columns' => array(
+ 'table1' => array(
+ 'column1',
+ 'column2',
+ ),
+ ),
+ 'add_unique_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ 'index2' => 'column2',
+ ),
+ ),
+ 'drop_keys' => array(
+ 'table1' => array(
+ 'column1',
+ 'column2',
+ ),
+ ),
+ 'add_primary_keys' => array(
+ 'table1' => array('foo'),
+ 'table2' => array('bar'),
+ 'table3' => array('foobar'),
+ ),
+ ),
+ array(
+ array('dbtools.perform_schema_changes', array(array('drop_tables' => array('table1')))),
+ array('dbtools.perform_schema_changes', array(array('drop_tables' => array('table2')))),
+ array('dbtools.perform_schema_changes', array(array('drop_tables' => array('table3')))),
+ array('dbtools.perform_schema_changes', array(array('add_tables' => array(
+ 'foo' => array(
+ 'COLUMNS' => array(
+ 'foobar' => array('BOOL', 0),
+ 'foobar2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('foobar'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_tables' => array(
+ 'bar' => array(
+ 'COLUMNS' => array(
+ 'barfoo' => array('BOOL', 0),
+ 'barfoor2' => array('BOOL', 0),
+ ),
+ 'PRIMARY_KEY' => array('barfoo'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('change_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('change_columns' => array(
+ 'table1' => array(
+ 'column2' => array('bar'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_columns' => array(
+ 'table1' => array(
+ 'column1' => array('foo'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_columns' => array(
+ 'table1' => array(
+ 'column2' => array('bar'),
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_keys' => array(
+ 'table1' => array(
+ 0 => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_keys' => array(
+ 'table1' => array(
+ 1 => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_columns' => array(
+ 'table1' => array(
+ 0 => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('drop_columns' => array(
+ 'table1' => array(
+ 1 => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_primary_keys' => array(
+ 'table1' => array('foo'),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_primary_keys' => array(
+ 'table2' => array('bar'),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_primary_keys' => array(
+ 'table3' => array('foobar'),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_unique_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_unique_index' => array(
+ 'table1' => array(
+ 'index2' => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table1' => array(
+ 'index1' => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table1' => array(
+ 'index2' => 'column2',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table2' => array(
+ 'index1' => 'column1',
+ ),
+ )))),
+ array('dbtools.perform_schema_changes', array(array('add_index' => array(
+ 'table2' => array(
+ 'index2' => 'column2',
+ ),
+ )))),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider schema_provider
+ */
+ public function test_get_schema_steps($schema_changes, $expected)
+ {
+ $this->assertEquals($expected, $this->helper->get_schema_steps($schema_changes));
+ }
+}
diff --git a/tests/notification/fixtures/convert.xml b/tests/notification/fixtures/convert.xml
index 3f0a065cc4..c9d8fafa97 100644
--- a/tests/notification/fixtures/convert.xml
+++ b/tests/notification/fixtures/convert.xml
@@ -8,8 +8,6 @@
<column>user_notify_pm</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>1</value>
@@ -18,8 +16,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -29,8 +25,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -40,8 +34,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
@@ -51,8 +43,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
@@ -62,8 +52,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
@@ -73,8 +61,6 @@
<value>1</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/notification/fixtures/group_request.xml b/tests/notification/fixtures/group_request.xml
index 1eb73f1e15..fbaee0a326 100644
--- a/tests/notification/fixtures/group_request.xml
+++ b/tests/notification/fixtures/group_request.xml
@@ -6,16 +6,12 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>2</value>
<value>2</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -23,8 +19,6 @@
<value>3</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/notification/fixtures/submit_post_bookmark.xml b/tests/notification/fixtures/submit_post_bookmark.xml
index d4bf8df73f..525d0484e0 100644
--- a/tests/notification/fixtures/submit_post_bookmark.xml
+++ b/tests/notification/fixtures/submit_post_bookmark.xml
@@ -79,55 +79,41 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>poster</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>test</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>unauthorized</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
<value>notified</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
<value>disabled</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>7</value>
<value>default</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_notifications">
diff --git a/tests/notification/fixtures/submit_post_post.xml b/tests/notification/fixtures/submit_post_post.xml
index b0ffa042c5..a38ca77ea0 100644
--- a/tests/notification/fixtures/submit_post_post.xml
+++ b/tests/notification/fixtures/submit_post_post.xml
@@ -109,55 +109,41 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>poster</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>test</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>unauthorized</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
<value>notified</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
<value>disabled</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>7</value>
<value>default</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_notifications">
diff --git a/tests/notification/fixtures/submit_post_post_in_queue.xml b/tests/notification/fixtures/submit_post_post_in_queue.xml
index 090e90ea49..28cb69be36 100644
--- a/tests/notification/fixtures/submit_post_post_in_queue.xml
+++ b/tests/notification/fixtures/submit_post_post_in_queue.xml
@@ -51,71 +51,53 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>poster</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>test</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>unauthorized-mod</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
<value>unauthorized-read</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
<value>notified</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>7</value>
<value>disabled</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>8</value>
<value>default</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>9</value>
<value>test glboal-permissions</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_notifications">
diff --git a/tests/notification/fixtures/submit_post_quote.xml b/tests/notification/fixtures/submit_post_quote.xml
index f22ed97d91..2b11992e54 100644
--- a/tests/notification/fixtures/submit_post_quote.xml
+++ b/tests/notification/fixtures/submit_post_quote.xml
@@ -51,55 +51,41 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>poster</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>test</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>unauthorized</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
<value>notified</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>6</value>
<value>disabled</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>7</value>
<value>default</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_user_notifications">
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index a96466347c..b7a4f101aa 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -38,6 +38,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
10,
'pagination
+ :per_page:10
+ :current_page:2
+ :base_url:page.php
:previous::page.php
:else:1:page.php
:current:2:page.php?start=10
@@ -57,6 +60,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
20,
'pagination
+ :per_page:10
+ :current_page:3
+ :base_url:page.php
:previous::page.php?start=10
:else:1:page.php
:else:2:page.php?start=10
@@ -77,6 +83,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
10,
'pagination
+ :per_page:10
+ :current_page:2
+ :base_url:test/page/%d
:previous::test
:else:1:test
:current:2:test/page/2
@@ -96,6 +105,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
10,
20,
'pagination
+ :per_page:10
+ :current_page:3
+ :base_url:test/page/%d
:previous::test/page/2
:else:1:test
:else:2:test/page/2
@@ -127,15 +139,10 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
{
return array(
array(
- 'page.php',
10,
10,
0,
'PAGE_OF-1-1',
- 'on_page
- per_page:10
- on_page:1
- base_url:page.php',
),
);
}
@@ -143,13 +150,9 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
/**
* @dataProvider on_page_data
*/
- public function test_on_page($base_url, $num_items, $per_page, $start_item, $expect_return, $expect)
+ public function test_on_page($num_items, $per_page, $start_item, $expect_return)
{
- $this->assertEquals($expect_return, $this->pagination->on_page($base_url, $num_items, $per_page, $start_item));
-
- $this->template->set_filenames(array('test' => 'on_page.html'));
-
- $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ $this->assertEquals($expect_return, $this->pagination->on_page($num_items, $per_page, $start_item));
}
public function validate_start_data()
diff --git a/tests/pagination/templates/on_page.html b/tests/pagination/templates/on_page.html
deleted file mode 100644
index 364bcf9f5e..0000000000
--- a/tests/pagination/templates/on_page.html
+++ /dev/null
@@ -1,4 +0,0 @@
-on_page
-per_page:{PER_PAGE}
-on_page:{ON_PAGE}
-base_url:{BASE_URL}
diff --git a/tests/pagination/templates/pagination.html b/tests/pagination/templates/pagination.html
index 7f2a329804..db63258585 100644
--- a/tests/pagination/templates/pagination.html
+++ b/tests/pagination/templates/pagination.html
@@ -1,4 +1,7 @@
pagination
+:per_page:{PER_PAGE}
+:current_page:{CURRENT_PAGE}
+:base_url:{BASE_URL}
<!-- BEGIN pagination -->
<!-- IF pagination.S_IS_PREV -->:previous:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
<!-- ELSEIF pagination.S_IS_CURRENT -->:current:{pagination.PAGE_NUMBER}:{pagination.PAGE_URL}
diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml
index 9a86501b7a..5f705c9fd2 100644
--- a/tests/privmsgs/fixtures/delete_user_pms.xml
+++ b/tests/privmsgs/fixtures/delete_user_pms.xml
@@ -8,8 +8,6 @@
<column>user_unread_privmsg</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>2</value>
<value>sender</value>
@@ -18,8 +16,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -29,8 +25,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
@@ -40,8 +34,6 @@
<value>2</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>5</value>
@@ -51,8 +43,6 @@
<value>0</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_privmsgs">
diff --git a/tests/session/fixtures/sessions_banlist.xml b/tests/session/fixtures/sessions_banlist.xml
index 9422fc0665..e720e35f0a 100644
--- a/tests/session/fixtures/sessions_banlist.xml
+++ b/tests/session/fixtures/sessions_banlist.xml
@@ -5,15 +5,11 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/session/fixtures/sessions_empty.xml b/tests/session/fixtures/sessions_empty.xml
index 0e6ddccd88..2acba58f45 100644
--- a/tests/session/fixtures/sessions_empty.xml
+++ b/tests/session/fixtures/sessions_empty.xml
@@ -5,31 +5,23 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>foo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>bar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/session/fixtures/sessions_full.xml b/tests/session/fixtures/sessions_full.xml
index 6bbaf1c9d5..4fb6b9dfd4 100644
--- a/tests/session/fixtures/sessions_full.xml
+++ b/tests/session/fixtures/sessions_full.xml
@@ -5,31 +5,23 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value>anonymous</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
<value>foo</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>4</value>
<value>bar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/session/fixtures/sessions_garbage.xml b/tests/session/fixtures/sessions_garbage.xml
index 23c44a975b..5eace839d0 100644
--- a/tests/session/fixtures/sessions_garbage.xml
+++ b/tests/session/fixtures/sessions_garbage.xml
@@ -5,15 +5,11 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>4</value>
<value>bar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
<table name="phpbb_sessions">
diff --git a/tests/session/fixtures/sessions_key.xml b/tests/session/fixtures/sessions_key.xml
index 246d284557..4f349cd282 100644
--- a/tests/session/fixtures/sessions_key.xml
+++ b/tests/session/fixtures/sessions_key.xml
@@ -30,15 +30,11 @@
<column>username_clean</column>
<column>user_permissions</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>4</value>
<value>bar</value>
<value></value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 71d03746a9..55f9cdb947 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -194,7 +194,8 @@ class phpbb_functional_test_case extends phpbb_test_case
$phpbb_root_path,
$php_ext,
self::$config['table_prefix'],
- array()
+ array(),
+ new \phpbb\db\migration\helper()
);
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
diff --git a/tests/user/fixtures/user_loader.xml b/tests/user/fixtures/user_loader.xml
index 1fed8b5838..f676f468a6 100644
--- a/tests/user/fixtures/user_loader.xml
+++ b/tests/user/fixtures/user_loader.xml
@@ -6,16 +6,12 @@
<column>username</column>
<column>username_clean</column>
<column>user_sig</column>
- <column>user_occ</column>
- <column>user_interests</column>
<row>
<value>1</value>
<value></value>
<value>Guest</value>
<value>guest</value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>2</value>
@@ -23,8 +19,6 @@
<value>Admin</value>
<value>admin</value>
<value></value>
- <value></value>
- <value></value>
</row>
<row>
<value>3</value>
@@ -32,8 +26,6 @@
<value>Test</value>
<value>test</value>
<value></value>
- <value></value>
- <value></value>
</row>
</table>
</dataset>