diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-10 11:38:48 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-10 11:38:48 -0500 |
commit | f88cdce43a2af0cf3672fd3846ae87477591805d (patch) | |
tree | 98b065aa94a6b5b49e4de62c7e4284105b24c62b | |
parent | 47ec38c011f3d3d86dacdc3126fc36cdec8b1072 (diff) | |
parent | 9725eb19f8dbc124febe0189799c0b2af0215c63 (diff) | |
download | forums-f88cdce43a2af0cf3672fd3846ae87477591805d.tar forums-f88cdce43a2af0cf3672fd3846ae87477591805d.tar.gz forums-f88cdce43a2af0cf3672fd3846ae87477591805d.tar.bz2 forums-f88cdce43a2af0cf3672fd3846ae87477591805d.tar.xz forums-f88cdce43a2af0cf3672fd3846ae87477591805d.zip |
Merge remote-tracking branch 'remotes/cyberalien/feature/twig/includejs_tests' into feature/twig
# By Vjacheslav Trushkin
# Via Vjacheslav Trushkin
* remotes/cyberalien/feature/twig/includejs_tests:
[feature/twig] Unit tests for includejs
-rw-r--r-- | tests/template/template_includejs_test.php | 24 | ||||
-rw-r--r-- | tests/template/templates/includejs.html | 15 |
2 files changed, 32 insertions, 7 deletions
diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index a57b219150..0061163eeb 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -18,12 +18,24 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes // Prepare correct result $scripts = array( - '<script type="text/javascript" src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=1"></script>', - '<script type="text/javascript" src="' . $this->test_path . '/parent_templates/parent_only.js?assets_version=1"></script>', - '<script type="text/javascript" src="' . $this->test_path . '/templates/child_only.js?assets_version=1"></script>', - '<script type="text/javascript" src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>', - '<script type="text/javascript" src="' . $this->test_path . '/templates/subdir/subsubdir/parent_only.js?assets_version=1"></script>', - '<script type="text/javascript" src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=0"></script>', + '<script src="' . $this->test_path . '/templates/parent_and_child.js?test=1&assets_version=0"></script>', + '<script src="' . $this->test_path . '/templates/parent_and_child.js?test=1&assets_version=0"></script>', + '<script src="' . $this->test_path . '/templates/parent_and_child.js?test=1;assets_version=0"></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>', + '<script src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/subdir/subsubdir/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>', + '<script src="' . $this->test_path . '/templates/child_only.js?test1=1&test2=2&assets_version=1#test3"></script>', + '<script src="' . $this->test_path . '/parent_templates/parent_only.js?test1=1&test2=2&assets_version=1#test3"></script>', + '<script src="' . $this->test_path . '/parent_templates/parent_only.js?test1=1;test2=2;assets_version=1#test3"></script>', + '<script src="' . $this->test_path . '/parent_templates/parent_only.js?test1="&assets_version=1#test3"></script>', + '<script src="//phpbb.com/b.js"></script>', + '<script src="http://phpbb.com/b.js?c=d#f"></script>', + '<script src="http://phpbb.com/b.js?c=d&assets_version=1#f"></script>', + '<script src="//[1234:d123:a105::123]/test.js"></script>', ); // Run test diff --git a/tests/template/templates/includejs.html b/tests/template/templates/includejs.html index 229f1ccc19..dd7b059f12 100644 --- a/tests/template/templates/includejs.html +++ b/tests/template/templates/includejs.html @@ -1,8 +1,21 @@ <!-- INCLUDEJS parent_and_child.js --> +<!-- INCLUDEJS parent_and_child.js?assets_version=0 --> +<!-- INCLUDEJS parent_and_child.js?test=1&assets_version=0 --> +<!-- INCLUDEJS parent_and_child.js?test=1&assets_version=0 --> +<!-- INCLUDEJS parent_and_child.js?test=1;assets_version=0 --> <!-- INCLUDEJS {PARENT} --> <!-- DEFINE $TEST = 'child_only.js' --> <!-- INCLUDEJS {$TEST} --> <!-- INCLUDEJS subdir/{PARENT} --> <!-- INCLUDEJS {SUBDIR}/subsubdir/{PARENT} --> <!-- INCLUDEJS {SUBDIR}/parent_only.{EXT} --> -{$SCRIPTS} +<!-- DEFINE $TEST = 'child_only.js?test1=1&test2=2#test3' --> +<!-- INCLUDEJS {$TEST} --> +<!-- INCLUDEJS parent_only.js?test1=1&test2=2#test3 --> +<!-- INCLUDEJS parent_only.js?test1=1;test2=2#test3 --> +<!-- INCLUDEJS parent_only.js?test1="#test3 --> +<!-- INCLUDEJS //phpbb.com/b.js --> +<!-- INCLUDEJS http://phpbb.com/b.js?c=d#f --> +<!-- INCLUDEJS http://phpbb.com/b.js?c=d&assets_version=1#f --> +<!-- INCLUDEJS //[1234:d123:a105::123]/test.js --> +{SCRIPTS} |