aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-13 10:58:03 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-13 10:58:03 -0500
commitb4a374dc73eda55db1c67b87bd65a73f79411ef5 (patch)
treeae392771a6aad76517e46b17c26797037c036a61 /tests
parent21624e79fc512fd86177080010bb7d26c71ce3cb (diff)
downloadforums-b4a374dc73eda55db1c67b87bd65a73f79411ef5.tar
forums-b4a374dc73eda55db1c67b87bd65a73f79411ef5.tar.gz
forums-b4a374dc73eda55db1c67b87bd65a73f79411ef5.tar.bz2
forums-b4a374dc73eda55db1c67b87bd65a73f79411ef5.tar.xz
forums-b4a374dc73eda55db1c67b87bd65a73f79411ef5.zip
[ticket/11832] Fix INCLUDE(JS/CSS)
PHPBB3-11832
Diffstat (limited to 'tests')
-rw-r--r--tests/controller/helper_url_test.php18
-rw-r--r--tests/dbal/migrator_test.php3
-rw-r--r--tests/extension/manager_test.php3
-rw-r--r--tests/extension/metadata_manager_test.php12
-rw-r--r--tests/filesystem/clean_path_test.php3
-rw-r--r--tests/filesystem/web_root_path_test.php15
-rw-r--r--tests/mock/extension_manager.php3
-rw-r--r--tests/template/template_events_test.php9
-rw-r--r--tests/template/template_test_case.php10
-rw-r--r--tests/template/template_test_case_with_tree.php10
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php3
11 files changed, 73 insertions, 16 deletions
diff --git a/tests/controller/helper_url_test.php b/tests/controller/helper_url_test.php
index da90947bb5..2dd7269caa 100644
--- a/tests/controller/helper_url_test.php
+++ b/tests/controller/helper_url_test.php
@@ -49,7 +49,14 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->user = $this->getMock('phpbb_user');
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
+ $phpbb_filesystem = new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $phpbb_root_path,
+ $phpEx
+ );
+ $this->template = new phpbb_template_twig($phpbb_filesystem, $config, $this->user, new phpbb_template_context());
// We don't use mod_rewrite in these tests
$config = new phpbb_config(array('enable_mod_rewrite' => '0'));
@@ -94,7 +101,14 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->user = $this->getMock('phpbb_user');
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
+ $phpbb_filesystem = new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $phpbb_root_path,
+ $phpEx
+ );
+ $this->template = new phpbb_template_twig($phpbb_filesystem, $config, $this->user, new phpbb_template_context());
$config = new phpbb_config(array('enable_mod_rewrite' => '1'));
$helper = new phpbb_controller_helper($this->template, $this->user, $config, '', '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/',
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index b9a920d092..07ca9fb417 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -118,7 +118,8 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
new phpbb_symfony_request(
new phpbb_mock_request()
),
- $phpbb_root_path
+ $phpbb_root_path,
+ $php_ext
),
'phpbb_ext',
dirname(__FILE__) . '/',
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 6b27929ebf..3ee10c3a74 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -41,8 +41,13 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->table_prefix = 'phpbb_';
$this->template = new phpbb_template_twig(
- $this->phpbb_root_path,
- $this->phpEx,
+ new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $this->phpbb_root_path,
+ $this->phpEx
+ ),
$this->config,
$this->user,
new phpbb_template_context()
@@ -69,7 +74,8 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
new phpbb_symfony_request(
new phpbb_mock_request()
),
- $this->phpbb_root_path
+ $this->phpbb_root_path,
+ $this->phpEx
),
'phpbb_ext',
$this->phpbb_root_path,
diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php
index b79668fc33..38ccf1b603 100644
--- a/tests/filesystem/clean_path_test.php
+++ b/tests/filesystem/clean_path_test.php
@@ -18,7 +18,8 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case
new phpbb_symfony_request(
new phpbb_mock_request()
),
- dirname(__FILE__) . './../../phpBB/'
+ dirname(__FILE__) . './../../phpBB/',
+ 'php'
);
}
diff --git a/tests/filesystem/web_root_path_test.php b/tests/filesystem/web_root_path_test.php
index b681c26de9..ae59d4f709 100644
--- a/tests/filesystem/web_root_path_test.php
+++ b/tests/filesystem/web_root_path_test.php
@@ -18,8 +18,13 @@ class phpbb_filesystem_web_root_path_test extends phpbb_test_case
$this->set_phpbb_root_path();
- $symfony_request = new phpbb_symfony_request(new phpbb_mock_request());
- $this->filesystem = new phpbb_filesystem($symfony_request, $this->phpbb_root_path);
+ $this->filesystem = new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $this->phpbb_root_path,
+ 'php'
+ );
}
/**
@@ -126,7 +131,11 @@ class phpbb_filesystem_web_root_path_test extends phpbb_test_case
->method('getScriptName')
->will($this->returnValue($getScriptName));
- $filesystem = new phpbb_filesystem($symfony_request, $this->phpbb_root_path);
+ $filesystem = new phpbb_filesystem(
+ $symfony_request,
+ $this->phpbb_root_path,
+ 'php'
+ );
$this->assertEquals($expected, $filesystem->update_web_root_path($input, $symfony_request));
}
diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php
index 0c73adcf47..0d1b6940ca 100644
--- a/tests/mock/extension_manager.php
+++ b/tests/mock/extension_manager.php
@@ -18,7 +18,8 @@ class phpbb_mock_extension_manager extends phpbb_extension_manager
new phpbb_symfony_request(
new phpbb_mock_request()
),
- $phpbb_root_path
+ $this->phpbb_root_path,
+ $this->php_ext
);
}
}
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 4280a7e7ff..58691a36da 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -116,7 +116,14 @@ Zeta test event in all',
$this->extension_manager = new phpbb_mock_filesystem_extension_manager(
dirname(__FILE__) . "/datasets/$dataset/"
);
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
+ $phpbb_filesystem = new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $phpbb_root_path,
+ $phpEx
+ );
+ $this->template = new phpbb_template_twig($phpbb_filesystem, $config, $user, new phpbb_template_context, $this->extension_manager);
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
}
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 91895502ad..8151e15b24 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -63,8 +63,16 @@ class phpbb_template_template_test_case extends phpbb_test_case
$config = new phpbb_config(array_merge($defaults, $new_config));
$this->user = new phpbb_user;
+ $phpbb_filesystem = new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $phpbb_root_path,
+ $phpEx
+ );
+
$this->template_path = $this->test_path . '/templates';
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
+ $this->template = new phpbb_template_twig($phpbb_filesystem, $config, $this->user, new phpbb_template_context());
$this->template->set_custom_style('tests', $this->template_path);
}
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 477192c28a..c4f3b4a257 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -18,9 +18,17 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$defaults = $this->config_defaults();
$config = new phpbb_config(array_merge($defaults, $new_config));
+ $phpbb_filesystem = new phpbb_filesystem(
+ new phpbb_symfony_request(
+ new phpbb_mock_request()
+ ),
+ $phpbb_root_path,
+ $phpEx
+ );
+
$this->template_path = $this->test_path . '/templates';
$this->parent_template_path = $this->test_path . '/parent_templates';
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
+ $this->template = new phpbb_template_twig($phpbb_filesystem, $config, $user, new phpbb_template_context());
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
}
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 48c5649281..00f166d4fe 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -207,7 +207,8 @@ class phpbb_functional_test_case extends phpbb_test_case
new phpbb_symfony_request(
new phpbb_mock_request()
),
- $phpbb_root_path
+ $phpbb_root_path,
+ $php_ext
),
self::$config['table_prefix'] . 'ext',
dirname(__FILE__) . '/',