1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

Merge remote-tracking branch 'github-phpbb/develop' into ticket/11700

* github-phpbb/develop: (586 commits)
  [ticket/11735] Display disabled checkbox in subsilver for read notifications
  [ticket/11735] Display disabled checkbox when notification is already read
  [ticket/11844] update acp/authentication language var
  [ticket/11795] Remove PM popup
  [ticket/11795] Remove outdated comment from forum_fn.js
  [ticket/11795] Move find user JS to forum_fn
  [ticket/11795] Replace TWIG with phpBB syntax in ACP
  [ticket/11795] Move MSN scripts to forum_fn.js
  [ticket/11795] Use phpBB template syntax instead of TWIG
  [ticket/11795] Move PM popup JS to forum_fn.js
  [ticket/11795] Get rid of pagination JS variables
  [ticket/11795] Get rid of onload_functions
  [ticket/11795] Use data-reset-on-edit attr to reset elements
  [ticket/11795] Redo form elements auto-focus
  [ticket/11811] Remove outline on :focus
  [ticket/11836] Fix subsilver fatal error
  [ticket/11837] Replace escaped single quote with utf-8 single quote
  [ticket/11836] Fix fatal error on unsupported provider for auth link
  [ticket/11837] Translate UCP_AUTH_LINK_NOT_SUPPORTED
  [ticket/11809] Ensure code.js is first script included after jQuery
  ...

Conflicts:
	phpBB/config/services.yml
	phpBB/develop/create_schema_files.php
	phpBB/develop/mysql_upgrader.php
	phpBB/download/file.php
	phpBB/includes/bbcode.php
	phpBB/includes/functions_container.php
	phpBB/install/database_update.php
	phpBB/install/index.php
	phpBB/phpbb/controller/helper.php
	phpBB/phpbb/controller/resolver.php
	phpBB/phpbb/request/request_interface.php
	phpBB/phpbb/session.php
	phpBB/phpbb/style/extension_path_provider.php
	phpBB/phpbb/style/path_provider.php
	phpBB/phpbb/style/path_provider_interface.php
	phpBB/phpbb/style/resource_locator.php
	phpBB/phpbb/style/style.php
	phpBB/phpbb/template/locator.php
	phpBB/phpbb/template/template.php
	phpBB/phpbb/template/twig/node/includeasset.php
	phpBB/phpbb/template/twig/node/includecss.php
	phpBB/phpbb/template/twig/node/includejs.php
	phpBB/phpbb/template/twig/twig.php
	tests/controller/helper_url_test.php
	tests/di/create_container_test.php
	tests/extension/style_path_provider_test.php
	tests/notification/notification_test.php
	tests/session/continue_test.php
	tests/session/creation_test.php
	tests/template/template_events_test.php
	tests/template/template_test_case.php
	tests/template/template_test_case_with_tree.php
	tests/test_framework/phpbb_functional_test_case.php
This commit is contained in:
Nils Adermann
2013-09-16 01:24:05 +02:00
330 changed files with 10287 additions and 6367 deletions

View File

@@ -0,0 +1 @@
{event_loop.S_ROW_COUNT}<!-- IF not event_loop.S_LAST_ROW -->|<!-- ENDIF -->

View File

@@ -0,0 +1,3 @@
<!-- BEGIN event_loop -->
event_loop<!-- EVENT test_event_loop -->
<!-- END event_loop -->

View File

@@ -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);
$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");

View File

@@ -80,6 +80,16 @@ Zeta test event in all',
array(),
'two in silver in omega',
),
array(
'EVENT in loop',
'ext_trivial',
array('silver'),
'event_loop.html',
array(),
array('event_loop' => array(array(), array(), array())),
array(),
'event_loop0|event_loop1|event_loop2',
),
);
}
@@ -103,13 +113,10 @@ Zeta test event in all',
$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->extension_manager = new phpbb_mock_filesystem_extension_manager(
dirname(__FILE__) . "/datasets/$dataset/"
);
$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, '');
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
}
}

View File

@@ -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),
@@ -93,49 +100,49 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop.html',
array(),
array('loop' => array(array())),
array('test_loop' => array(array())),
array(),
"loop\nloop",
),
array(
'loop.html',
array(),
array('loop' => array(array(), array()), 'loop.block' => array(array())),
array('test_loop' => array(array(), array()), 'test_loop.block' => array(array())),
array(),
"loop\nloop\nloop\nloop",
),
array(
'loop.html',
array(),
array('loop' => array(array(), array()), 'loop.block' => array(array()), 'block' => array(array(), array())),
array('test_loop' => array(array(), array()), 'test_loop.block' => array(array()), 'block' => array(array(), array())),
array(),
"loop\nloop\nloop\nloop\nloop#0-block#0\nloop#0-block#1\nloop#1-block#0\nloop#1-block#1",
),
array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'))),
array('test_loop' => array(array('VARIABLE' => 'x'))),
array(),
"first\n0 - a\nx - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
array(),
"first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast",
),
array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
array(),
"first\n0 - a\nx - b\nset\n1 - a\ny - b\nset\nlast\n0 - c\n1 - c\nlast inner",
),
array(
'loop_advanced.html',
array(),
array('loop' => array(array(), array(), array(), array(), array(), array(), array())),
array('test_loop' => array(array(), array(), array(), array(), array(), array(), array())),
array(),
"101234561\nx\n101234561\nx\n101234561\nx\n1234561\nx\n1\nx\n101\nx\n234\nx\n10\nx\n561\nx\n561",
),
@@ -149,14 +156,14 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'define.html',
array(),
array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(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\nabc\nbar\nbar\nabc",
"xyz\nabc\n\$VALUE == 'abc'\n(\$VALUE == 'abc')\n!\$DOESNT_EXIST\n(!\$DOESNT_EXIST)\nabc\nbar\nbar\nabc\ntest!@#$%^&*()_-=+{}[]:;\",<.>/?[]|foobar|",
),
array(
'define_advanced.html',
array(),
array('loop' => array(array(), array(), array(), array(), array(), array(), array()), 'test' => array(array()), 'test.deep' => array(array()), 'test.deep.defines' => array(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(),
"abc\nzxc\ncde\nbcd",
),
@@ -200,7 +207,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'include_loop.html',
array(),
array('loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))),
array('test_loop' => array(array('NESTED_FILE' => 'include_loop1.html')), 'test_loop.inner' => array(array('NESTED_FILE' => 'include_loop1.html'), array('NESTED_FILE' => 'include_loop2.html'), array('NESTED_FILE' => 'include_loop3.html'))),
array(),
"1\n_1\n_02\n_3",
),
@@ -221,8 +228,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
array('loop'),
array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
array('test_loop'),
'',
),
array(
@@ -230,12 +237,12 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array('VARIABLE' => 'variable.html'),
array(),
array(),
'variable.html',
"variable.html\nvariable.html\nvariable.html",
),
array(
'include_loop_define.html',
array('VARIABLE' => 'value'),
array('loop' => array(array('NESTED_FILE' => 'variable.html'))),
array('test_loop' => array(array('NESTED_FILE' => 'variable.html'))),
array(),
'value',
),
@@ -243,8 +250,8 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_vars.html',
array(),
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'loop.inner' => array(array(), array())),
array('loop.inner'),
array('test_loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y')), 'test_loop.inner' => array(array(), array())),
array('test_loop.inner'),
"first\n0\n0\n2\nx\nset\n1\n1\n2\ny\nset\nlast",
),*/
array(
@@ -295,7 +302,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(
'loop_size.html',
array(),
array('loop' => array(array()), 'empty_loop' => array()),
array('test_loop' => array(array()), 'empty_loop' => array()),
array(),
"nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop",
),
@@ -410,7 +417,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);
$this->run_template('php.html', array(), array(), array(), 'test');
}

View File

@@ -11,11 +11,8 @@ 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 $style_resource_locator;
protected $style_provider;
protected $user;
protected $test_path = 'tests/template';
@@ -67,11 +64,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\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(), '');
$this->template->set_custom_style('tests', $this->template_path);
}
protected function setUp()

View File

@@ -20,10 +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->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(), '');
$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));
}
}

View File

@@ -2,8 +2,27 @@
{$VALUE}
<!-- DEFINE $VALUE = 'abc' -->
{$VALUE}
<!-- IF $VALUE != 'abc' -->
$VALUE != 'abc'
<!-- ELSEIF $VALUE == 'abc' -->
$VALUE == 'abc'
<!-- ENDIF -->
<!-- IF ($VALUE == 'abc') -->
($VALUE == 'abc')
<!-- ENDIF -->
<!-- IF !$DOESNT_EXIST -->
!$DOESNT_EXIST
<!-- ENDIF -->
<!-- IF (!$DOESNT_EXIST) -->
(!$DOESNT_EXIST)
<!-- ENDIF -->
<!-- INCLUDE define_include.html -->
{$INCLUDED_VALUE}
{$VALUE}
<!-- UNDEFINE $VALUE -->
{$VALUE}
<!-- DEFINE $VALUE = 'test!@#$%^&*()_-=+{}[]:;",<.>/?' -->
{$VALUE}
<!-- DEFINE $VALUE = '' -->
[{$VALUE}]
<!-- DEFINE $TEST -->foobar<!-- ENDDEFINE -->|{$TEST}|

View File

@@ -2,6 +2,8 @@
1
<!-- ELSEIF S_OTHER_VALUE -->
2
<!-- ELSE IF S_OTHER_OTHER_VALUE -->
|S_OTHER_OTHER_VALUE|
<!-- ELSE -->
03
<!-- ENDIF -->

View File

@@ -1,2 +1,8 @@
<!-- DEFINE $DEF = '{VARIABLE}' -->
<!-- INCLUDE {$DEF} -->
<!-- DEFINE $DEF_WITH_UNDERSCORES = '{VARIABLE}' -->
<!-- INCLUDE {$DEF_WITH_UNDERSCORES} -->
<!-- DEFINE $DEF123 = '{VARIABLE}' -->
<!-- INCLUDE {$DEF123} -->

View File

@@ -1,4 +1,4 @@
<!-- BEGIN loop -->
<!-- INCLUDE {loop.NESTED_FILE} -->
<!-- BEGIN inner -->_<!-- INCLUDE {inner.NESTED_FILE} --><!-- END inner -->
<!-- END loop -->
<!-- BEGIN test_loop -->
<!-- INCLUDE {test_loop.NESTED_FILE} -->
<!-- BEGIN inner -->_<!-- INCLUDE {test_loop.inner.NESTED_FILE} --><!-- END inner -->
<!-- END test_loop -->

View File

@@ -1,4 +1,4 @@
<!-- BEGIN loop -->
<!-- DEFINE $DEF = '{loop.NESTED_FILE}' -->
<!-- BEGIN test_loop -->
<!-- DEFINE $DEF = '{test_loop.NESTED_FILE}' -->
<!-- INCLUDE {$DEF} -->
<!-- END loop -->
<!-- END test_loop -->

View File

@@ -1,21 +1,21 @@
<!-- BEGIN loop -->
<!-- BEGIN test_loop -->
loop
<!-- BEGINELSE -->
noloop
<!-- END loop -->
<!-- END test_loop -->
<!-- IF .loop -->
<!-- IF .test_loop -->
loop
<!-- ELSE -->
noloop
<!-- ENDIF -->
<!-- IF .loop == 2 -->
<!-- IF .test_loop == 2 -->
loop
<!-- ENDIF -->
<!-- BEGIN loop -->
<!-- BEGIN test_loop -->
<!-- BEGIN !block -->
loop#{loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
loop#{test_loop.S_ROW_COUNT}-block#{block.S_ROW_COUNT}
<!-- END !block -->
<!-- END loop -->
<!-- END test_loop -->

View File

@@ -1,19 +1,19 @@
<!-- BEGIN loop -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(0) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(0) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(0,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(0,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(1,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(1,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(0,1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(0,1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(2,4) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(2,4) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(0,-7) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(0,-7) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(-2,6) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(-2,6) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->
x
<!-- BEGIN loop(-2,-1) -->{loop.S_FIRST_ROW}{loop.S_ROW_COUNT}{loop.S_LAST_ROW}<!-- END loop -->
<!-- BEGIN test_loop(-2,-1) -->{test_loop.S_FIRST_ROW}{test_loop.S_ROW_COUNT}{test_loop.S_LAST_ROW}<!-- END test_loop -->

View File

@@ -22,18 +22,18 @@
! empty
<!-- ENDIF -->
<!-- IF .loop -->
<!-- IF .test_loop -->
loop
<!-- ENDIF -->
<!-- IF .loop == 0 -->
<!-- IF .test_loop == 0 -->
loop = 0
<!-- ENDIF -->
<!-- IF ! .loop -->
<!-- IF ! .test_loop -->
! loop
<!-- ENDIF -->
<!-- BEGIN loop -->
<!-- BEGIN test_loop -->
in loop
<!-- END loop -->
<!-- END test_loop -->

View File

@@ -1,13 +1,13 @@
<!-- BEGIN loop -->
<!-- IF loop.S_FIRST_ROW -->first<!-- ENDIF -->
{loop.S_ROW_NUM} - a
{loop.VARIABLE} - b
<!-- IF loop.VARIABLE -->set<!-- ENDIF -->
<!-- IF loop.S_LAST_ROW -->
<!-- BEGIN test_loop -->
<!-- IF test_loop.S_FIRST_ROW -->first<!-- ENDIF -->
{test_loop.S_ROW_NUM} - a
{test_loop.VARIABLE} - b
<!-- IF test_loop.VARIABLE -->set<!-- ENDIF -->
<!-- IF test_loop.S_LAST_ROW -->
last
<!-- ENDIF -->
<!-- BEGIN inner -->
{inner.S_ROW_NUM} - c
<!-- IF inner.S_LAST_ROW and inner.S_ROW_COUNT and inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
{test_loop.inner.S_ROW_NUM} - c
<!-- IF test_loop.inner.S_LAST_ROW and test_loop.inner.S_ROW_COUNT and test_loop.inner.S_NUM_ROWS -->last inner<!-- ENDIF -->
<!-- END inner -->
<!-- END loop -->
<!-- END test_loop -->