From f30b87519e9ead41525e1979cbce874e8a84e2b8 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 9 Sep 2013 17:28:56 -0500 Subject: [ticket/11832] Inject dependencies for phpbb_get_web_root_path (also moving) Function moved from phpbb_get_web_root_path to filesystem::get_web_root_path PHPBB3-11832 --- tests/dbal/migrator_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/dbal/migrator_test.php') diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 9e55e4dd35..4be1fbe176 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -59,7 +59,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $container, $this->db, $this->config, - new phpbb_filesystem(), + new phpbb_filesystem(dirname(__FILE__) . '/../../phpBB/'), 'phpbb_ext', dirname(__FILE__) . '/../../phpBB/', 'php', -- cgit v1.2.1 From 21624e79fc512fd86177080010bb7d26c71ce3cb Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 13 Sep 2013 10:04:35 -0500 Subject: [ticket/11832] Fix constructions of phpbb_filesystem PHPBB3-11832 --- tests/dbal/migrator_test.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/dbal/migrator_test.php') diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 4be1fbe176..5f0818d568 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -59,7 +59,12 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $container, $this->db, $this->config, - new phpbb_filesystem(dirname(__FILE__) . '/../../phpBB/'), + new phpbb_filesystem( + new phpbb_symfony_request( + new phpbb_mock_request() + ), + dirname(__FILE__) . '/../../phpBB/' + ), 'phpbb_ext', dirname(__FILE__) . '/../../phpBB/', 'php', -- cgit v1.2.1 From b4a374dc73eda55db1c67b87bd65a73f79411ef5 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 13 Sep 2013 10:58:03 -0500 Subject: [ticket/11832] Fix INCLUDE(JS/CSS) PHPBB3-11832 --- tests/dbal/migrator_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/dbal/migrator_test.php') diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 5f0818d568..d722439b3f 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -63,7 +63,8 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case new phpbb_symfony_request( new phpbb_mock_request() ), - dirname(__FILE__) . '/../../phpBB/' + dirname(__FILE__) . '/../../phpBB/', + 'php' ), 'phpbb_ext', dirname(__FILE__) . '/../../phpBB/', -- cgit v1.2.1 From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:01:09 +0200 Subject: [ticket/11700] Move all recent code to namespaces PHPBB3-11700 --- tests/dbal/migrator_test.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'tests/dbal/migrator_test.php') diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 9e55e4dd35..d336854a1c 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -33,15 +33,15 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case parent::setUp(); $this->db = $this->new_dbal(); - $this->db_tools = new phpbb_db_tools($this->db); + $this->db_tools = new \phpbb\db\tools($this->db); - $this->config = new phpbb_config_db($this->db, new phpbb_mock_cache, 'phpbb_config'); + $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, '\phpbb\config\config'); $tools = array( - new phpbb_db_migration_tool_config($this->config), + new \phpbb\db\migration\tool\config($this->config), ); - $this->migrator = new phpbb_db_migrator( + $this->migrator = new \phpbb\db\migrator( $this->config, $this->db, $this->db_tools, @@ -55,11 +55,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $container = new phpbb_mock_container_builder(); $container->set('migrator', $migrator); - $this->extension_manager = new phpbb_extension_manager( + $this->extension_manager = new \phpbb\extension\manager( $container, $this->db, $this->config, - new phpbb_filesystem(), + new \phpbb\filesystem(), 'phpbb_ext', dirname(__FILE__) . '/../../phpBB/', 'php', @@ -91,7 +91,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('extra_column' => '1')), - "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'", + "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'", 'Dummy migration created extra_column with value 1 in all rows.' ); @@ -107,7 +107,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case ); // cleanup - $this->db_tools->sql_column_remove('phpbb_config', 'extra_column'); + $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column'); } public function test_unfulfillable() @@ -123,11 +123,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('extra_column' => '1')), - "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'", + "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'", 'Dummy migration was run, even though an unfulfillable migration was found.' ); - $this->db_tools->sql_column_remove('phpbb_config', 'extra_column'); + $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column'); } public function test_if() @@ -192,7 +192,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('bar_column' => '1')), - "SELECT bar_column FROM phpbb_config WHERE config_name = 'foo'", + "SELECT bar_column FROM \phpbb\config\config WHERE config_name = 'foo'", 'Installing revert migration failed to create bar_column.' ); @@ -208,7 +208,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertFalse(isset($this->config['foobartest'])); - $sql = 'SELECT * FROM phpbb_config'; + $sql = 'SELECT * FROM \phpbb\config\config'; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); @@ -232,12 +232,12 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->migrator->update(); } } - catch (phpbb_db_migration_exception $e) {} + catch (\phpbb\db\migration\exception $e) {} // Failure should have caused an automatic roll-back, so this should not exist. $this->assertFalse(isset($this->config['foobar3'])); - $sql = 'SELECT * FROM phpbb_config'; + $sql = 'SELECT * FROM \phpbb\config\config'; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); -- cgit v1.2.1 From 97012dd85151018e003aa8abf793ad04206a5627 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 10 Sep 2013 14:52:07 +0200 Subject: [ticket/11700] Fix dbal tests after config namespace mishap PHPBB3-11700 --- tests/dbal/migrator_test.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/dbal/migrator_test.php') diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index d336854a1c..6679ae407b 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -35,7 +35,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->db = $this->new_dbal(); $this->db_tools = new \phpbb\db\tools($this->db); - $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, '\phpbb\config\config'); + $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, 'phpbb_config'); $tools = array( new \phpbb\db\migration\tool\config($this->config), @@ -91,7 +91,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('extra_column' => '1')), - "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'", + "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'", 'Dummy migration created extra_column with value 1 in all rows.' ); @@ -107,7 +107,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case ); // cleanup - $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column'); + $this->db_tools->sql_column_remove('phpbb_config', 'extra_column'); } public function test_unfulfillable() @@ -123,11 +123,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('extra_column' => '1')), - "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'", + "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'", 'Dummy migration was run, even though an unfulfillable migration was found.' ); - $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column'); + $this->db_tools->sql_column_remove('phpbb_config', 'extra_column'); } public function test_if() @@ -192,7 +192,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertSqlResultEquals( array(array('bar_column' => '1')), - "SELECT bar_column FROM \phpbb\config\config WHERE config_name = 'foo'", + "SELECT bar_column FROM phpbb_config WHERE config_name = 'foo'", 'Installing revert migration failed to create bar_column.' ); @@ -208,7 +208,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->assertFalse(isset($this->config['foobartest'])); - $sql = 'SELECT * FROM \phpbb\config\config'; + $sql = 'SELECT * FROM phpbb_config'; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); @@ -237,7 +237,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case // Failure should have caused an automatic roll-back, so this should not exist. $this->assertFalse(isset($this->config['foobar3'])); - $sql = 'SELECT * FROM \phpbb\config\config'; + $sql = 'SELECT * FROM phpbb_config'; $result = $this->db->sql_query_limit($sql, 1); $row = $this->db->sql_fetchrow($result); $this->db->sql_freeresult($result); -- cgit v1.2.1 From 9d8ac2b0ceb24dd14df61d083505941afb1b52c4 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 17 Sep 2013 17:12:41 +0200 Subject: [ticket/11700] Fix unit tests after develop merge PHPBB3-11700 --- tests/dbal/migrator_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/dbal/migrator_test.php') diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php index 6481e09ead..ef5d167fc2 100644 --- a/tests/dbal/migrator_test.php +++ b/tests/dbal/migrator_test.php @@ -60,7 +60,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case $this->db, $this->config, new phpbb\filesystem( - new phpbb\symfony\request( + new phpbb\symfony_request( new phpbb_mock_request() ), dirname(__FILE__) . '/../../phpBB/', -- cgit v1.2.1