From 8bda356dabae89b8dff62796a6bf6e9b57cd85c1 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Mon, 24 Jun 2013 22:40:17 -0500 Subject: [feature/twig] Correct includejs test PHPBB3-11598 --- tests/template/template_includejs_test.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tests/template/template_includejs_test.php') diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index 22b020208b..c0169bd385 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -18,16 +18,15 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes // Prepare correct result $scripts = array( - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', ); // Run test - $cache_file = $this->template->cachepath . 'includejs.html.php'; - $this->run_template('includejs.html', array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), array(), array(), implode('', $scripts), $cache_file); + $this->run_template('includejs.html', array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), array(), array(), implode('', $scripts)); } } -- cgit v1.2.1 From c6c064a1360cf6ef488adbe516cea5c4d7138f0c Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Tue, 2 Jul 2013 11:21:31 -0500 Subject: [feature/twig] Fix includejs test PHPBB3-11598 --- tests/template/template_includejs_test.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/template/template_includejs_test.php') diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index c0169bd385..67381b1fd4 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -18,12 +18,12 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes // Prepare correct result $scripts = array( - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', ); // Run test -- cgit v1.2.1 From b4947f94ed23270d4dbb498afb31555da2c8af0d Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Tue, 2 Jul 2013 12:43:26 -0500 Subject: [feature/twig] Should compare to $this->test_path rather than hardcoded path PHPBB3-11598 --- tests/template/template_includejs_test.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/template/template_includejs_test.php') diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index 67381b1fd4..a57b219150 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -18,12 +18,12 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes // Prepare correct result $scripts = array( - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', ); // Run test -- cgit v1.2.1 From 9725eb19f8dbc124febe0189799c0b2af0215c63 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Wed, 10 Jul 2013 11:43:52 -0400 Subject: [feature/twig] Unit tests for includejs PHPBB3-11598 --- tests/template/template_includejs_test.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'tests/template/template_includejs_test.php') 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( - '', - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', ); // Run test -- cgit v1.2.1 From 8d8979eda76cba8e98e6428542db9aaf00edf2d8 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Wed, 10 Jul 2013 13:23:36 -0500 Subject: [ticket/11388] Fixing includejs test Changed expected output to file?(any supplied argument string)&asset_version =($config['asset_version'])#(any supplied anchor string) Testing lines one at a time to make checking them easier. PHPBB3-11388 --- tests/template/template_includejs_test.php | 105 ++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 23 deletions(-) (limited to 'tests/template/template_includejs_test.php') diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index 0061163eeb..b644c8b6f0 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -11,34 +11,93 @@ 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() + public function template_data() + { + return array( + /* + array( + // vars + // expected + ), + */ + array( + array('TEST' => 1), + '', + ), + array( + array('TEST' => 2), + '', + ), + array( + array('TEST' => 3), + '', + ), + array( + array('TEST' => 4), + '', + ), + array( + array('TEST' => 5), + '', + ), + array( + array('TEST' => 6), + '', + ), + array( + array('TEST' => 7), + '', + ), + array( + array('TEST' => 8), + '', + ), + array( + array('TEST' => 9), + '', + ), + array( + array('TEST' => 10), + '', + ), + array( + array('TEST' => 11), + '', + ), + array( + array('TEST' => 12), + '', + ), + array( + array('TEST' => 13), + '', + ), + array( + array('TEST' => 14), + '', + ), + array( + array('TEST' => 15), + '', + ), + array( + array('TEST' => 16), + '', + ), + ); + } + + /** + * @dataProvider template_data + */ + public function test_includejs_compilation($vars, $expected) { // Reset the engine state $this->setup_engine(array('assets_version' => 1)); - // Prepare correct result - $scripts = array( - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - ); + $this->template->assign_vars($vars); // Run test - $this->run_template('includejs.html', array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), array(), array(), implode('', $scripts)); + $this->run_template('includejs.html', array_merge(array('PARENT' => 'parent_only.js', 'SUBDIR' => 'subdir', 'EXT' => 'js'), $vars), array(), array(), $expected); } } -- cgit v1.2.1 From 648e1e51fad1c2198a30f62c50d7d2272134c399 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Thu, 11 Jul 2013 08:44:48 -0500 Subject: [ticket/11388] INCLUDEJS test for //(url) PHPBB3-11388 --- tests/template/template_includejs_test.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/template/template_includejs_test.php') diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index b644c8b6f0..d4a384a1c5 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -84,6 +84,10 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes array('TEST' => 16), '', ), + array( + array('TEST' => 17), + '', + ), ); } -- cgit v1.2.1 From 947b907efef43704c620507db17aff4fe115f219 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Thu, 11 Jul 2013 11:28:35 -0500 Subject: [ticket/11388] Do not append assets_version if using remote path (e.g. http) PHPBB3-11388 --- tests/template/template_includejs_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/template/template_includejs_test.php') diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php index d4a384a1c5..ea5c30891b 100644 --- a/tests/template/template_includejs_test.php +++ b/tests/template/template_includejs_test.php @@ -78,15 +78,15 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes ), array( array('TEST' => 15), - '', + '', ), array( array('TEST' => 16), - '', + '', ), array( array('TEST' => 17), - '', + '', ), ); } -- cgit v1.2.1