From 44a82dd0837a4693b6a4a410c21c438f244094d3 Mon Sep 17 00:00:00 2001
From: Nathaniel Guse <nathaniel.guse@gmail.com>
Date: Wed, 24 Jul 2013 12:05:04 -0500
Subject: [ticket/11628] Remove style path provider

No longer used since Twig was implemented.

PHPBB3-11628
---
 tests/template/template_events_test.php         | 4 +---
 tests/template/template_test_case.php           | 6 +-----
 tests/template/template_test_case_with_tree.php | 4 +---
 3 files changed, 3 insertions(+), 11 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index f7bcd2dcc6..c3ebcb8739 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -103,13 +103,11 @@ Zeta test event in all',
 		$config = new phpbb_config(array_merge($defaults, $new_config));
 
 		$this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
-		$this->style_resource_locator = new phpbb_style_resource_locator();
 		$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);
-		$this->style_provider = new phpbb_style_path_provider();
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->template);
 		$this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
 	}
 }
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 6d87e5ebc0..87573a53fe 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -14,8 +14,6 @@ class phpbb_template_template_test_case extends phpbb_test_case
 	protected $style;
 	protected $template;
 	protected $template_path;
-	protected $style_resource_locator;
-	protected $style_provider;
 	protected $user;
 
 	protected $test_path = 'tests/template';
@@ -67,10 +65,8 @@ class phpbb_template_template_test_case extends phpbb_test_case
 		$this->user = new phpbb_user;
 
 		$this->template_path = $this->test_path . '/templates';
-		$this->style_resource_locator = new phpbb_style_resource_locator();
-		$this->style_provider = new phpbb_style_path_provider();
 		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
+		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $this->user, $this->template);
 		$this->style->set_custom_style('tests', $this->template_path, array(), '');
 	}
 
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 4b8cbada45..50a6e9190d 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -20,10 +20,8 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 
 		$this->template_path = $this->test_path . '/templates';
 		$this->parent_template_path = $this->test_path . '/parent_templates';
-		$this->style_resource_locator = new phpbb_style_resource_locator();
-		$this->style_provider = new phpbb_style_path_provider();
 		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->template);
 		$this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
 	}
 }
-- 
cgit v1.2.1


From 5d1afb453211d42a8deacb66684c136385918192 Mon Sep 17 00:00:00 2001
From: Nathaniel Guse <nathaniel.guse@gmail.com>
Date: Wed, 24 Jul 2013 12:24:35 -0500
Subject: [ticket/11628] Remove phpbb_style (move methods to phpbb_template)

PHPBB3-11628
---
 tests/template/includephp_test.php              | 2 +-
 tests/template/template_events_test.php         | 3 +--
 tests/template/template_test.php                | 2 +-
 tests/template/template_test_case.php           | 4 +---
 tests/template/template_test_case_with_tree.php | 3 +--
 5 files changed, 5 insertions(+), 9 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index ff7b890d11..1afa933514 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -46,7 +46,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
 
 		$this->setup_engine(array('tpl_allow_php' => true));
 
-		$this->style->set_custom_style('tests', $cache_dir, array(), '');
+		$this->template->set_custom_style('tests', $cache_dir, array(), '');
 
 		$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
 
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index c3ebcb8739..7de3ebbfae 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -107,7 +107,6 @@ Zeta test event in all',
 			dirname(__FILE__) . "/datasets/$dataset/"
 		);
 		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->template);
-		$this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
+		$this->template->set_custom_style('silver', array($this->template_path), $style_names, '');
 	}
 }
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index dd9ba21c26..3989f10229 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -410,7 +410,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 
 		$this->setup_engine(array('tpl_allow_php' => true));
 
-		$this->style->set_custom_style('tests', $cache_dir, array(), '');
+		$this->template->set_custom_style('tests', $cache_dir, array(), '');
 
 		$this->run_template('php.html', array(), array(), array(), 'test');
 	}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 87573a53fe..f90d291d15 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -11,7 +11,6 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
 
 class phpbb_template_template_test_case extends phpbb_test_case
 {
-	protected $style;
 	protected $template;
 	protected $template_path;
 	protected $user;
@@ -66,8 +65,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
 
 		$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->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $this->user, $this->template);
-		$this->style->set_custom_style('tests', $this->template_path, array(), '');
+		$this->template->set_custom_style('tests', $this->template_path, array(), '');
 	}
 
 	protected function setUp()
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 50a6e9190d..7de719f430 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -21,7 +21,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 		$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->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->template);
-		$this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
+		$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
 	}
 }
-- 
cgit v1.2.1


From 4b761f65758c40db4851983fa3a08d354da3323d Mon Sep 17 00:00:00 2001
From: Nathaniel Guse <nathaniel.guse@gmail.com>
Date: Wed, 24 Jul 2013 12:55:41 -0500
Subject: [ticket/11628] Remove third parameter ($names) from set_custom_style

This was basically duplicating functionality. $names would be used if not
empty, else array($name) would be used. Merged functionality into the first
argument

PHPBB3-11628
---
 tests/template/includephp_test.php              | 2 +-
 tests/template/template_events_test.php         | 2 +-
 tests/template/template_test.php                | 2 +-
 tests/template/template_test_case.php           | 2 +-
 tests/template/template_test_case_with_tree.php | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index 1afa933514..70e7cea232 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -46,7 +46,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
 
 		$this->setup_engine(array('tpl_allow_php' => true));
 
-		$this->template->set_custom_style('tests', $cache_dir, array(), '');
+		$this->template->set_custom_style('tests', $cache_dir, '');
 
 		$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
 
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 7de3ebbfae..1b2ab38e2b 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -107,6 +107,6 @@ Zeta test event in all',
 			dirname(__FILE__) . "/datasets/$dataset/"
 		);
 		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
-		$this->template->set_custom_style('silver', array($this->template_path), $style_names, '');
+		$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path), '');
 	}
 }
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 3989f10229..0cc53f4d07 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -410,7 +410,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 
 		$this->setup_engine(array('tpl_allow_php' => true));
 
-		$this->template->set_custom_style('tests', $cache_dir, array(), '');
+		$this->template->set_custom_style('tests', $cache_dir, '');
 
 		$this->run_template('php.html', array(), array(), array(), 'test');
 	}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index f90d291d15..00c89e4501 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -65,7 +65,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
 
 		$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->set_custom_style('tests', $this->template_path, array(), '');
+		$this->template->set_custom_style('tests', $this->template_path, '');
 	}
 
 	protected function setUp()
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 7de719f430..1a29fd27b0 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -21,6 +21,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 		$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->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
+		$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path), '');
 	}
 }
-- 
cgit v1.2.1


From 12c22585069066957cc3211136ebd480295d4758 Mon Sep 17 00:00:00 2001
From: Nathaniel Guse <nathaniel.guse@gmail.com>
Date: Wed, 24 Jul 2013 13:25:20 -0500
Subject: [ticket/11628] Remove template_path option on set_custom_style

This was set to default 'template/' to append template/ to all the paths,
but every location was actually just setting it to '' to not append anything.
So removed the option entirely (additional paths can be appended to the paths
being sent to the function already)

PHPBB3-11628
---
 tests/template/includephp_test.php              | 2 +-
 tests/template/template_events_test.php         | 2 +-
 tests/template/template_test.php                | 2 +-
 tests/template/template_test_case.php           | 2 +-
 tests/template/template_test_case_with_tree.php | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index 70e7cea232..a0dd8368cf 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -46,7 +46,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
 
 		$this->setup_engine(array('tpl_allow_php' => true));
 
-		$this->template->set_custom_style('tests', $cache_dir, '');
+		$this->template->set_custom_style('tests', $cache_dir);
 
 		$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
 
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 1b2ab38e2b..f0cdeb39c5 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -107,6 +107,6 @@ Zeta test event in all',
 			dirname(__FILE__) . "/datasets/$dataset/"
 		);
 		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
-		$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path), '');
+		$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
 	}
 }
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 0cc53f4d07..2f3ca6e313 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -410,7 +410,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 
 		$this->setup_engine(array('tpl_allow_php' => true));
 
-		$this->template->set_custom_style('tests', $cache_dir, '');
+		$this->template->set_custom_style('tests', $cache_dir);
 
 		$this->run_template('php.html', array(), array(), array(), 'test');
 	}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 00c89e4501..91895502ad 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -65,7 +65,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
 
 		$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->set_custom_style('tests', $this->template_path, '');
+		$this->template->set_custom_style('tests', $this->template_path);
 	}
 
 	protected function setUp()
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 1a29fd27b0..477192c28a 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -21,6 +21,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 		$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->set_custom_style('tests', array($this->template_path, $this->parent_template_path), '');
+		$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
 	}
 }
-- 
cgit v1.2.1


From d5c56c5d503ea4b12852866e2d3b956e92a92aea Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Sat, 27 Jul 2013 20:02:03 -0500
Subject: [ticket/11724] Support "ELSE IF" and "ELSEIF" in the same way

PHPBB3-11724
---
 tests/template/template_test.php | 7 +++++++
 tests/template/templates/if.html | 2 ++
 2 files changed, 9 insertions(+)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index dd9ba21c26..2a40107d90 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -62,6 +62,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				'1!false',
 			),
+			array(
+				'if.html',
+				array('S_OTHER_OTHER_VALUE' => true),
+				array(),
+				array(),
+				'|S_OTHER_OTHER_VALUE|!false',
+			),
 			array(
 				'if.html',
 				array('S_VALUE' => false, 'S_OTHER_VALUE' => true),
diff --git a/tests/template/templates/if.html b/tests/template/templates/if.html
index c010aff7fa..f6ab6e575a 100644
--- a/tests/template/templates/if.html
+++ b/tests/template/templates/if.html
@@ -2,6 +2,8 @@
 1
 <!-- ELSEIF S_OTHER_VALUE -->
 2
+<!-- ELSE IF S_OTHER_OTHER_VALUE -->
+|S_OTHER_OTHER_VALUE|
 <!-- ELSE -->
 03
 <!-- ENDIF -->
-- 
cgit v1.2.1


From 62e81d174d9d3dbd78baea36425720ed0fdaffb1 Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Thu, 29 Aug 2013 09:19:14 -0500
Subject: [ticket/11816] Fix define/loop checks in IF statements containing
 parenthesis

PHPBB3-11816
---
 tests/template/template_test.php     | 2 +-
 tests/template/templates/define.html | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 0a6b680100..0473218353 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -151,7 +151,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
 				array(),
-				"xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
+				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
 			),
 			array(
 				'define_advanced.html',
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 66e874ca63..12842ad387 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -7,6 +7,9 @@ $VALUE != 'abc'
 <!-- ELSEIF $VALUE == 'abc' -->
 $VALUE == 'abc'
 <!-- ENDIF -->
+<!-- IF ($VALUE == 'abc') -->
+($VALUE == 'abc')
+<!-- ENDIF -->
 <!-- INCLUDE define_include.html -->
 {$INCLUDED_VALUE}
 {$VALUE}
-- 
cgit v1.2.1


From 0c5a39a3ed382bef37005e59de66120e3cf205fa Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Mon, 2 Sep 2013 15:50:34 -0500
Subject: [ticket/11816] Test !$DEFINITION

PHPBB3-11816
---
 tests/template/template_test.php     | 2 +-
 tests/template/templates/define.html | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 0473218353..94289842df 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -151,7 +151,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
 				array(),
-				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
+				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
 			),
 			array(
 				'define_advanced.html',
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 12842ad387..e96d14e813 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -10,6 +10,9 @@ $VALUE == 'abc'
 <!-- IF ($VALUE == 'abc') -->
 ($VALUE == 'abc')
 <!-- ENDIF -->
+<!-- IF (!$DOESNT_EXIST) -->
+(!$DOESNT_EXIST)
+<!-- ENDIF -->
 <!-- INCLUDE define_include.html -->
 {$INCLUDED_VALUE}
 {$VALUE}
-- 
cgit v1.2.1


From c8d5ec892745f9bfc784cd8f7f632fee4a371ff7 Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Mon, 2 Sep 2013 16:35:42 -0500
Subject: [ticket/11812] Fix empty define

PHPBB3-11812
---
 tests/template/template_test.php     | 2 +-
 tests/template/templates/define.html | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 38eb072df8..f2e3903458 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -158,7 +158,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
 				array(),
-				"xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
+				"xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?\n[]",
 			),
 			array(
 				'define_advanced.html',
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index 66e874ca63..e6c8ef49c9 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -14,3 +14,5 @@ $VALUE == 'abc'
 {$VALUE}
 <!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
 {$VALUE}
+<!-- DEFINE $VALUE = '' -->
+[{$VALUE}]
-- 
cgit v1.2.1


From 11317ef261c7811ea137d19ee38593d289ea6150 Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Fri, 6 Sep 2013 09:04:40 -0500
Subject: [ticket/11816] !$DOESNT_EXIST test

PHPBB3-11816
---
 tests/template/template_test.php     | 2 +-
 tests/template/templates/define.html | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 94289842df..b41193d59e 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -151,7 +151,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
 				array(),
-				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
+				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?",
 			),
 			array(
 				'define_advanced.html',
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index e96d14e813..a56fece912 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -10,6 +10,9 @@ $VALUE == 'abc'
 <!-- IF ($VALUE == 'abc') -->
 ($VALUE == 'abc')
 <!-- ENDIF -->
+<!-- IF !$DOESNT_EXIST -->
+!$DOESNT_EXIST
+<!-- ENDIF -->
 <!-- IF (!$DOESNT_EXIST) -->
 (!$DOESNT_EXIST)
 <!-- ENDIF -->
-- 
cgit v1.2.1


From 8c2f73bb09dc1fa305b59c2adabdc47fd3d5afdb Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Thu, 12 Sep 2013 14:15:41 -0500
Subject: [ticket/11828] Fix greedy operators in lexer

Use lazy operators and use stricter validation

PHPBB3-11828
---
 tests/template/template_test.php     | 2 +-
 tests/template/templates/define.html | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index f2e3903458..e64493e59a 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -158,7 +158,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
 				array(),
-				"xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?\n[]",
+				"xyz\nabc\n\$VALUE == 'abc'abc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?\n[]|foobar|",
 			),
 			array(
 				'define_advanced.html',
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index e6c8ef49c9..f519078a5b 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -16,3 +16,4 @@ $VALUE == 'abc'
 {$VALUE}
 <!-- DEFINE $VALUE = '' -->
 [{$VALUE}]
+<!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}|
-- 
cgit v1.2.1


From 45ecbae1edd32224dd6e2b1aaee5f289afddb7b9 Mon Sep 17 00:00:00 2001
From: rechosen <rechosen@gmail.com>
Date: Fri, 13 Sep 2013 12:27:07 +0200
Subject: [ticket/11843] Add checking DEFINE variables with underscores to
 template_test

To prevent the underscore in DEFINE variables from being forgotten again,
the template tests now test INCLUDEing a file based on the contents of a
DEFINE variable with underscores in it.

PHPBB3-11843
---
 tests/template/template_test.php                      | 2 +-
 tests/template/templates/include_define_variable.html | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 1649604492..c28c7a70bc 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -237,7 +237,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array('VARIABLE' => 'variable.html'),
 				array(),
 				array(),
-				'variable.html',
+				'variable.htmlvariable.html',
 			),
 			array(
 				'include_loop_define.html',
diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html
index aff9b574c2..fceeebf5df 100644
--- a/tests/template/templates/include_define_variable.html
+++ b/tests/template/templates/include_define_variable.html
@@ -1,2 +1,4 @@
 <!-- DEFINE $DEF = '{VARIABLE}' -->
 <!-- INCLUDE {$DEF} -->
+<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF_WITH_UNDERSCORES} -->
-- 
cgit v1.2.1


From 658f6e204510b328509a0387eb9711617fdc3bee Mon Sep 17 00:00:00 2001
From: rechosen <rechosen@gmail.com>
Date: Fri, 13 Sep 2013 13:48:00 +0200
Subject: [ticket/11843] Added newlines and included numbers in the DEFINE vars
 test

Per suggestion of nickvergessen, I added newlines in the DEFINE variables with
underscores test. Now if the test fails, it's easier to spot which part is
failing. Also added a test for DEFINE variables containing numbers.

PHPBB3-11843
---
 tests/template/template_test.php                      | 2 +-
 tests/template/templates/include_define_variable.html | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index c28c7a70bc..2cca20f4c2 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -237,7 +237,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array('VARIABLE' => 'variable.html'),
 				array(),
 				array(),
-				'variable.htmlvariable.html',
+				"variable.html\nvariable.html\nvariable.html",
 			),
 			array(
 				'include_loop_define.html',
diff --git a/tests/template/templates/include_define_variable.html b/tests/template/templates/include_define_variable.html
index fceeebf5df..6052657c97 100644
--- a/tests/template/templates/include_define_variable.html
+++ b/tests/template/templates/include_define_variable.html
@@ -1,4 +1,8 @@
 <!-- DEFINE $DEF = '{VARIABLE}' -->
 <!-- INCLUDE {$DEF} -->
+
 <!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' -->
 <!-- INCLUDE {$DEF_WITH_UNDERSCORES} -->
+
+<!-- DEFINE $DEF123 = '{VARIABLE}' -->
+<!-- INCLUDE {$DEF123} -->
-- 
cgit v1.2.1


From b4a374dc73eda55db1c67b87bd65a73f79411ef5 Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Fri, 13 Sep 2013 10:58:03 -0500
Subject: [ticket/11832] Fix INCLUDE(JS/CSS)

PHPBB3-11832
---
 tests/template/template_events_test.php         |  9 ++++++++-
 tests/template/template_test_case.php           | 10 +++++++++-
 tests/template/template_test_case_with_tree.php | 10 +++++++++-
 3 files changed, 26 insertions(+), 3 deletions(-)

(limited to 'tests/template')

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));
 	}
 }
-- 
cgit v1.2.1


From b95fdacdd378877d277e261465da73deb06e50da Mon Sep 17 00:00:00 2001
From: Nils Adermann <naderman@naderman.de>
Date: Tue, 10 Sep 2013 14:01:09 +0200
Subject: [ticket/11700] Move all recent code to namespaces

PHPBB3-11700
---
 tests/template/template_events_test.php         | 10 +++++-----
 tests/template/template_test_case.php           | 12 ++++++------
 tests/template/template_test_case_with_tree.php | 10 +++++-----
 3 files changed, 16 insertions(+), 16 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index f7bcd2dcc6..857807bf89 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -100,16 +100,16 @@ Zeta test event in all',
 		global $phpbb_root_path, $phpEx, $user;
 
 		$defaults = $this->config_defaults();
-		$config = new phpbb_config(array_merge($defaults, $new_config));
+		$config = new \phpbb\config\config(array_merge($defaults, $new_config));
 
 		$this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
-		$this->style_resource_locator = new phpbb_style_resource_locator();
+		$this->style_resource_locator = new \phpbb\style\resource_locator();
 		$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);
-		$this->style_provider = new phpbb_style_path_provider();
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+		$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context, $this->extension_manager);
+		$this->style_provider = new \phpbb\style\path_provider();
+		$this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
 		$this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
 	}
 }
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 6d87e5ebc0..97c0728875 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -63,14 +63,14 @@ class phpbb_template_template_test_case extends phpbb_test_case
 		global $phpbb_root_path, $phpEx;
 
 		$defaults = $this->config_defaults();
-		$config = new phpbb_config(array_merge($defaults, $new_config));
-		$this->user = new phpbb_user;
+		$config = new \phpbb\config\config(array_merge($defaults, $new_config));
+		$this->user = new \phpbb\user;
 
 		$this->template_path = $this->test_path . '/templates';
-		$this->style_resource_locator = new phpbb_style_resource_locator();
-		$this->style_provider = new phpbb_style_path_provider();
-		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
+		$this->style_resource_locator = new \phpbb\style\resource_locator();
+		$this->style_provider = new \phpbb\style\path_provider();
+		$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
+		$this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
 		$this->style->set_custom_style('tests', $this->template_path, array(), '');
 	}
 
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 4b8cbada45..9f97e92fd2 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -16,14 +16,14 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 		global $phpbb_root_path, $phpEx, $user;
 
 		$defaults = $this->config_defaults();
-		$config = new phpbb_config(array_merge($defaults, $new_config));
+		$config = new \phpbb\config\config(array_merge($defaults, $new_config));
 
 		$this->template_path = $this->test_path . '/templates';
 		$this->parent_template_path = $this->test_path . '/parent_templates';
-		$this->style_resource_locator = new phpbb_style_resource_locator();
-		$this->style_provider = new phpbb_style_path_provider();
-		$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
-		$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+		$this->style_resource_locator = new \phpbb\style\resource_locator();
+		$this->style_provider = new \phpbb\style\path_provider();
+		$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
+		$this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
 		$this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
 	}
 }
-- 
cgit v1.2.1


From cd141883a59ca474c844f9e206333dbd79699695 Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Sun, 15 Sep 2013 18:55:18 -0500
Subject: [ticket/11832] Correct paths in tests

PHPBB3-11832
---
 tests/template/template_includecss_test.php     |  4 ++--
 tests/template/template_includejs_test.php      | 28 +++++++++++++------------
 tests/template/template_test_case_with_tree.php |  4 ++--
 3 files changed, 19 insertions(+), 17 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php
index f8999ad1a9..c00aa8e9bb 100644
--- a/tests/template/template_includecss_test.php
+++ b/tests/template/template_includecss_test.php
@@ -18,8 +18,8 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
 
 		// Prepare correct result
 		$scripts = array(
-			'<link href="' . $this->test_path . '/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
-			'<link href="' . $this->test_path . '/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+			'<link href="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+			'<link href="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
 		);
 
 		// Run test
diff --git a/tests/template/template_includejs_test.php b/tests/template/template_includejs_test.php
index b67fa123a1..2faeb5fcaa 100644
--- a/tests/template/template_includejs_test.php
+++ b/tests/template/template_includejs_test.php
@@ -13,6 +13,8 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes
 {
 	public function template_data()
 	{
+		$this->setup_engine();
+
 		return array(
 			/*
 			array(
@@ -22,51 +24,51 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes
 			*/
 			array(
 				array('TEST' => 1),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/parent_and_child.js?assets_version=1"></script>',
 			),
 			array(
 				array('TEST' => 2),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/parent_and_child.js?assets_version=0"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/parent_and_child.js?assets_version=0"></script>',
 			),
 			array(
 				array('TEST' => 3),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/parent_and_child.js?test=1&assets_version=0"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/parent_and_child.js?test=1&assets_version=0"></script>',
 			),
 			array(
 				array('TEST' => 4),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/parent_and_child.js?test=1&amp;assets_version=0"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/parent_and_child.js?test=1&amp;assets_version=0"></script>',
 			),
 			array(
 				array('TEST' => 6),
-				'<script type="text/javascript" src="' . $this->test_path . '/parent_templates/parent_only.js?assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/parent_templates/parent_only.js?assets_version=1"></script>',
 			),
 			array(
 				array('TEST' => 7),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/child_only.js?assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/child_only.js?assets_version=1"></script>',
 			),
 			array(
 				array('TEST' => 8),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/subdir/parent_only.js?assets_version=1"></script>',
 			),
 			array(
 				array('TEST' => 9),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/subdir/subsubdir/parent_only.js?assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/subdir/subsubdir/parent_only.js?assets_version=1"></script>',
 			),
 			array(
 				array('TEST' => 10),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/subdir/parent_only.js?assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/subdir/parent_only.js?assets_version=1"></script>',
 			),
 			array(
 				array('TEST' => 11),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/child_only.js?test1=1&amp;test2=2&amp;assets_version=1#test3"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/child_only.js?test1=1&amp;test2=2&amp;assets_version=1#test3"></script>',
 			),
 			array(
 				array('TEST' => 12),
-				'<script type="text/javascript" src="' . $this->test_path . '/parent_templates/parent_only.js?test1=1&amp;test2=2&amp;assets_version=1#test3"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/parent_templates/parent_only.js?test1=1&amp;test2=2&amp;assets_version=1#test3"></script>',
 			),
 			array(
 				array('TEST' => 14),
-				'<script type="text/javascript" src="' . $this->test_path . '/parent_templates/parent_only.js?test1=&quot;&amp;assets_version=1#test3"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/parent_templates/parent_only.js?test1=&quot;&amp;assets_version=1#test3"></script>',
 			),
 			array(
 				array('TEST' => 15),
@@ -82,7 +84,7 @@ class phpbb_template_template_includejs_test extends phpbb_template_template_tes
 			),
 			array(
 				array('TEST' => 18),
-				'<script type="text/javascript" src="' . $this->test_path . '/templates/parent_and_child.js?test=1&test2=0&amp;assets_version=1"></script>',
+				'<script type="text/javascript" src="' . $this->phpbb_filesystem->get_web_root_path() . 'tests/template/templates/parent_and_child.js?test=1&test2=0&amp;assets_version=1"></script>',
 			),
 		);
 	}
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index c4f3b4a257..c7bd03a3c7 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -18,7 +18,7 @@ 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(
+		$this->phpbb_filesystem = new phpbb_filesystem(
 			new phpbb_symfony_request(
 				new phpbb_mock_request()
 			),
@@ -28,7 +28,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 
 		$this->template_path = $this->test_path . '/templates';
 		$this->parent_template_path = $this->test_path . '/parent_templates';
-		$this->template = new phpbb_template_twig($phpbb_filesystem, $config, $user, new phpbb_template_context());
+		$this->template = new phpbb_template_twig($this->phpbb_filesystem, $config, $user, new phpbb_template_context());
 		$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
 	}
 }
-- 
cgit v1.2.1


From 2472271bc0cd7c15c77783c86ccaac643ab1756a Mon Sep 17 00:00:00 2001
From: Nils Adermann <naderman@naderman.de>
Date: Mon, 16 Sep 2013 02:41:03 +0200
Subject: [ticket/11700] Fix tests after merging new develop code

PHPBB3-11700
---
 tests/template/template_test_case_with_tree.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 461534a49d..438aa66471 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -20,7 +20,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 
 		$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\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
 		$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
 	}
 }
-- 
cgit v1.2.1


From 9d8ac2b0ceb24dd14df61d083505941afb1b52c4 Mon Sep 17 00:00:00 2001
From: Nils Adermann <naderman@naderman.de>
Date: Tue, 17 Sep 2013 17:12:41 +0200
Subject: [ticket/11700] Fix unit tests after develop merge

PHPBB3-11700
---
 tests/template/template_events_test.php         | 2 +-
 tests/template/template_test_case.php           | 4 ++--
 tests/template/template_test_case_with_tree.php | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'tests/template')

diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 41ece4972b..4155d5fd83 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -117,7 +117,7 @@ Zeta test event in all',
 			dirname(__FILE__) . "/datasets/$dataset/"
 		);
 		$phpbb_filesystem = new \phpbb\filesystem(
-			new \phpbb\symfony\request(
+			new \phpbb\symfony_request(
 				new phpbb_mock_request()
 			),
 			$phpbb_root_path,
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index c9b38ee40d..e9cbdec1d9 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -63,8 +63,8 @@ class phpbb_template_template_test_case extends phpbb_test_case
 		$config = new \phpbb\config\config(array_merge($defaults, $new_config));
 		$this->user = new \phpbb\user;
 
-		$phpbb_filesystem = new phpbb_filesystem(
-			new phpbb_symfony_request(
+		$phpbb_filesystem = new \phpbb\filesystem(
+			new \phpbb\symfony_request(
 				new phpbb_mock_request()
 			),
 			$phpbb_root_path,
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 7f7cffdb82..232331d37c 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -18,8 +18,8 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
 		$defaults = $this->config_defaults();
 		$config = new \phpbb\config\config(array_merge($defaults, $new_config));
 
-		$this->phpbb_filesystem = new phpbb_filesystem(
-			new phpbb_symfony_request(
+		$this->phpbb_filesystem = new \phpbb\filesystem(
+			new \phpbb\symfony_request(
 				new phpbb_mock_request()
 			),
 			$phpbb_root_path,
-- 
cgit v1.2.1


From 9152455d706adafa4e89bfdf6acc4b7c101f6f0a Mon Sep 17 00:00:00 2001
From: Nathan Guse <nathaniel.guse@gmail.com>
Date: Thu, 19 Sep 2013 12:40:53 -0500
Subject: [ticket/11816] Fix multiple parenthesis as well before $VARs in
 templates

PHPBB3-11816
---
 tests/template/template_test.php     | 2 +-
 tests/template/templates/define.html | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

(limited to 'tests/template')

diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 2cca20f4c2..39eb08ab79 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -158,7 +158,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
 				array(),
 				array('test_loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(array())),
 				array(),
-				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|",
+				"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n((\$VALUE == 'abc'))\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|",
 			),
 			array(
 				'define_advanced.html',
diff --git a/tests/template/templates/define.html b/tests/template/templates/define.html
index bc20c02ed1..e7ce7f7def 100644
--- a/tests/template/templates/define.html
+++ b/tests/template/templates/define.html
@@ -10,6 +10,9 @@ $VALUE == 'abc'
 <!-- IF ($VALUE == 'abc') -->
 ($VALUE == 'abc')
 <!-- ENDIF -->
+<!-- IF (($VALUE == 'abc')) -->
+(($VALUE == 'abc'))
+<!-- ENDIF -->
 <!-- IF !$DOESNT_EXIST -->
 !$DOESNT_EXIST
 <!-- ENDIF -->
-- 
cgit v1.2.1