diff options
Diffstat (limited to 'tests/template/template_includejs_test.php')
-rw-r--r-- | tests/template/template_includejs_test.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php new file mode 100644 index 0000000000..a8f9a9037f --- /dev/null +++ b/tests/template/template_includejs_test.php @@ -0,0 +1,30 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2011 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +require_once dirname(__FILE__) . '/template_test_case_with_tree.php'; + +class phpbb_template_template_includejs_test extends phpbb_template_template_test_case_with_tree +{ + public function test_includejs_compilation() + { + // Reset the engine state + $this->setup_engine(array('assets_version' => 1)); + + // Prepare correct result + $scripts = array( + '<script src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/parent_templates/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/child_only.js?assets_version=1"></script>' + ); + + // Run test + $cache_file = $this->template->cachepath . 'includejs.html.php'; + $this->run_template('includejs.html', array('PARENT' => 'parent_only.js'), array(), array(), implode('', $scripts), $cache_file); + } +} |