diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index e6429b8c4f..57b31a840f 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -125,4 +125,18 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te // Run test $this->run_template('includecss.html', array(), array(), array(), $expected); } + + /** + * @dataProvider template_data + */ + public function test_include_css_compilation($vars, $expected) + { + // Reset the engine state + $this->setup_engine(array('assets_version' => 1)); + + $this->template->assign_vars($vars); + + // Run test + $this->run_template('include_css.html', array(), array(), array(), $expected); + } } diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index 7580d4b32d..035be4da0b 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -106,4 +106,18 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes // Run test $this->run_template('includejs.html', array_merge(array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), $vars), array(), array(), $expected); } + + /** + * @dataProvider template_data + */ + public function test_include_js_compilation($vars, $expected) + { + // Reset the engine state + $this->setup_engine(array('assets_version' => 1)); + + $this->template->assign_vars($vars); + + // Run test + $this->run_template('include_js.html', array_merge(array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), $vars), array(), array(), $expected); + } } diff --git a/tests/template/templates/include_css.html b/tests/template/templates/include_css.html index 23e3c426d7..a8f644e406 100644 --- a/tests/template/templates/include_css.html +++ b/tests/template/templates/include_css.html @@ -1,10 +1,10 @@ - - - - - - - - - +{% if TEST === 1 %} + {% include_css('child_only.css') %} +{% elseif TEST === 2 %} + {% include_css('parent_only.css') %} +{% elseif TEST === 3 %} + {% include_css('@include_css/test.css') %} +{% elseif TEST === 4 %} + {% include_css('@include_css/child_only.css') %} +{% endif %} {$STYLESHEETS} diff --git a/tests/template/templates/include_js.html b/tests/template/templates/include_js.html index 0bcdf1a815..96ed42ebc7 100644 --- a/tests/template/templates/include_js.html +++ b/tests/template/templates/include_js.html @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{% if TEST === 1 %} + {% include_js('parent_and_child.js') %} +{% elseif TEST === 2 %} + {% include_js('parent_and_child.js?assets_version=0') %} +{% elseif TEST === 3 %} + {% include_js('parent_and_child.js?test=1&assets_version=0') %} +{% elseif TEST === 4 %} + {% include_js('parent_and_child.js?test=1&assets_version=0') %} +{% elseif TEST === 6 %} + {% include_js(PARENT) %} +{% elseif TEST === 7 %} + {% set test_var = 'child_only.js' %} + {% include_js(test_var) %} +{% elseif TEST === 8 %} + {% include_js('subdir/' ~ PARENT) %} +{% elseif TEST === 9 %} + {% include_js(SUBDIR ~ '/subsubdir/' ~ PARENT) %} +{% elseif TEST === 10 %} + {% include_js(SUBDIR ~ '/parent_only.' ~ EXT) %} +{% elseif TEST === 11 %} + {% set test_var = 'child_only.js?test1=1&test2=2#test3' %} + {% include_js(test_var) %} +{% elseif TEST === 12 %} + {% include_js('parent_only.js?test1=1&test2=2#test3') %} +{% elseif TEST === 14 %} + {% include_js('parent_only.js?test1="#test3') %} +{% elseif TEST === 15 %} + {% include_js('http://phpbb.com/b.js?c=d#f') %} +{% elseif TEST === 16 %} + {% include_js('http://phpbb.com/b.js?c=d&assets_version=2#f') %} +{% elseif TEST === 17 %} + {% include_js('//phpbb.com/b.js') %} +{% elseif TEST === 18 %} + {% include_js('parent_and_child.js?test=1&test2=0') %} +{% endif %} {$SCRIPTS}