diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dbal/migration/dummy.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/fail.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/if.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/installed.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/recall.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/revert.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/revert_with_dependency.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/schema.php | 2 | ||||
-rw-r--r-- | tests/dbal/migration/unfulfillable.php | 2 | ||||
-rw-r--r-- | tests/dbal/migrator_test.php | 2 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_config_test.php | 2 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_module_test.php | 2 | ||||
-rw-r--r-- | tests/dbal/migrator_tool_permission_test.php | 2 | ||||
-rw-r--r-- | tests/functions/parse_cfg_file_test.php | 2 | ||||
-rw-r--r-- | tests/migrator/schema_generator_test.php | 49 |
15 files changed, 63 insertions, 14 deletions
diff --git a/tests/dbal/migration/dummy.php b/tests/dbal/migration/dummy.php index 041c529855..b68a3673c1 100644 --- a/tests/dbal/migration/dummy.php +++ b/tests/dbal/migration/dummy.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/fail.php b/tests/dbal/migration/fail.php index d90972720d..b0702a469a 100644 --- a/tests/dbal/migration/fail.php +++ b/tests/dbal/migration/fail.php @@ -3,7 +3,7 @@ * * @package migration * @copyright (c) 2012 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/if.php b/tests/dbal/migration/if.php index bbbda60ea3..883d93c6e4 100644 --- a/tests/dbal/migration/if.php +++ b/tests/dbal/migration/if.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/installed.php b/tests/dbal/migration/installed.php index 4b86896d9c..cc4e81aff6 100644 --- a/tests/dbal/migration/installed.php +++ b/tests/dbal/migration/installed.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/recall.php b/tests/dbal/migration/recall.php index 041d12ad27..af5e9243cf 100644 --- a/tests/dbal/migration/recall.php +++ b/tests/dbal/migration/recall.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php index 1882b20492..c2520f4d8a 100644 --- a/tests/dbal/migration/revert.php +++ b/tests/dbal/migration/revert.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/revert_with_dependency.php b/tests/dbal/migration/revert_with_dependency.php index 0b09fb784d..ece16eb67c 100644 --- a/tests/dbal/migration/revert_with_dependency.php +++ b/tests/dbal/migration/revert_with_dependency.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/schema.php b/tests/dbal/migration/schema.php index 98407eb1bd..efe6891aaa 100644 --- a/tests/dbal/migration/schema.php +++ b/tests/dbal/migration/schema.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2014 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migration/unfulfillable.php b/tests/dbal/migration/unfulfillable.php index a1cdef9a23..125629d27c 100644 --- a/tests/dbal/migration/unfulfillable.php +++ b/tests/dbal/migration/unfulfillable.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index f22f5f5b30..c18c49b2a0 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php index 807399385c..12644e4a23 100644 --- a/tests/dbal/migrator_tool_config_test.php +++ b/tests/dbal/migrator_tool_config_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php index 3c23891348..c3358ef944 100644 --- a/tests/dbal/migrator_tool_module_test.php +++ b/tests/dbal/migrator_tool_module_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php index 1090b4726a..4016cbcf20 100644 --- a/tests/dbal/migrator_tool_permission_test.php +++ b/tests/dbal/migrator_tool_permission_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/functions/parse_cfg_file_test.php b/tests/functions/parse_cfg_file_test.php index 69000ddf72..920fc2eaa7 100644 --- a/tests/functions/parse_cfg_file_test.php +++ b/tests/functions/parse_cfg_file_test.php @@ -21,7 +21,7 @@ class phpbb_functions_parse_cfg_file extends phpbb_test_case '#', '# @package phpBB3', '# @copyright (c) 2005 phpBB Group', - '# @license http://opensource.org/licenses/gpl-license.php GNU Public License', + '# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2', '#', '#', '# At the left is the name, please do not change this', diff --git a/tests/migrator/schema_generator_test.php b/tests/migrator/schema_generator_test.php new file mode 100644 index 0000000000..4bac447229 --- /dev/null +++ b/tests/migrator/schema_generator_test.php @@ -0,0 +1,49 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +class schmema_generator_test extends phpbb_test_case +{ + public function setUp() + { + parent::setUp(); + + $this->config = new \phpbb\config\config(array()); + $this->db = new \phpbb\db\driver\sqlite(); + $this->db_tools = new \phpbb\db\tools($this->db); + $this->table_prefix = 'phpbb_'; + } + + protected function get_schema_generator(array $class_names) + { + $this->generator = new \phpbb\db\migration\schema_generator($class_names, $this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix); + + return $this->generator; + } + + /** + * @expectedException \UnexpectedValueException + */ + public function test_check_dependencies_fail() + { + $this->get_schema_generator(array('\phpbb\db\migration\data\v310\forgot_password')); + + $this->generator->get_schema(); + } + + public function test_get_schema_success() + { + $this->get_schema_generator(array( + '\phpbb\db\migration\data\v30x\release_3_0_1_rc1', + '\phpbb\db\migration\data\v30x\release_3_0_0', + '\phpbb\db\migration\data\v310\boardindex' + )); + + $this->assertArrayHasKey('phpbb_users', $this->generator->get_schema()); + } +} |