1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 12:33:29 +01:00

82 Commits

Author SHA1 Message Date
Andreas Fischer
af66fbb93b Merge branch 'develop' of git://github.com/phpbb/phpbb3 into develop
* 'develop' of git://github.com/phpbb/phpbb3:
  [ticket/10392] Alter parent namespace stripping.
  [ticket/10392] Test for magic loop variables with nested namespaces.
  [ticket/10392] Missed fix for S_BLOCK_NAME.
  [ticket/10392] Fix access to nested special block variables.
2011-09-27 20:24:16 +02:00
Chris Smith
118bc6198e [ticket/10392] Test for magic loop variables with nested namespaces.
PHPBB3-10392
2011-09-27 01:02:58 +01:00
Chris Smith
fbb5c641b8 [ticket/10384] Update unit tests to test for failing variable.
PHPBB3-10384
2011-09-24 20:48:37 +01:00
Patrick Webster
b5a79009ce [ticket/10322] Separate template varref resolution from output generation
Most template variables can now have their PHP variable name resolved instead
of only compiling directly. This allows for the use of block vars in INCLUDE
statements. This does not work for language variables since they require
multiple checks. Added tests for the new types of allowed INCLUDEs.

PHPBB3-10322
2011-09-16 01:46:42 -05:00
Patrick Webster
b5ecb2f7a8 [ticket/10322] Dynamic template include test
PHPBB3-10322
2011-09-08 17:54:59 -05:00
Oleg Pudeyev
367fe0b4cf Merge remote-tracking branch 'cyberalien/ticket/10350' into develop
* cyberalien/ticket/10350:
  [ticket/10350] Script for testing eval renderer
  [ticket/10350] Fix for class phpbb_template_renderer_eval
2011-09-05 05:21:19 -04:00
Vjacheslav Trushkin
d8f4f92dae [ticket/10350] Script for testing eval renderer
Script for testing eval renderer (fixed)

PHPBB3-10350
2011-09-05 11:57:18 +03:00
Igor Wiedler
bbb10f576f Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10354] Include cache directory path in unwritable message.

Conflicts:
	tests/template/template_test.php
2011-09-05 09:20:06 +02:00
Oleg Pudeyev
511f2e0435 [ticket/10355] Correctly end output buffering in template tests.
This code was copied verbatim from develop-olympus.

PHPBB3-10355
2011-09-05 02:07:44 -04:00
Oleg Pudeyev
1061e881bd [ticket/10354] Include cache directory path in unwritable message.
When template tests are skipped because cache directory is not
writable, include path to the cache directory into the message
saying it is not writable.

PHPBB3-10354
2011-09-05 01:20:57 -04:00
Oleg Pudeyev
acb767f14d [feature/template-engine] Dependency inject locator into template.
PHPBB3-9726
2011-08-09 23:28:40 -04:00
Oleg Pudeyev
05b71ca04e [feature/template-engine] Factor template locator out of template class.
Template locator is responsible for maintaining mapping from template
handles to filenames and paths, and provides resolution services
using these mappings.

Template locator is aware of template inheritance and is capable of
checking template file existence on the filesystem.

PHPBB3-9726
2011-07-30 17:06:22 -04:00
Oleg Pudeyev
e116561348 [feature/template-engine] Rename is_absolute to phpbb_is_absolute.
PHPBB3-9726
2011-07-24 13:37:46 -04:00
Nils Adermann
ee203b4632 [feature/template-engine] Test template DEFINE statements across files
PHPBB3-9726
2011-07-17 14:28:56 -04:00
Igor Wiedler
c58b09e65d [feature/template-engine] Remove $include_once argument of display()
PHPBB3-9726
2011-07-10 01:05:54 +02:00
Igor Wiedler
ae53623230 [feature/template-engine] Refactor $config dependency out of the filter
The template stream filter no longer depends on the $config global.
Instead it uses a 'allow_php' param that is passed via
stream_bucket_append's last argument.

Tests also adjusted.

PHPBB3-9726
2011-07-10 00:35:07 +02:00
Igor Wiedler
f7b06ca12d [feature/template-engine] Move template.php to includes/template
This allows making use of autoloading.

PHPBB3-9726
2011-07-10 00:30:50 +02:00
Oleg Pudeyev
1d26398faa [feature/template-engine] Fixed copyright year.
PHPBB3-9726
2011-05-19 22:55:08 -04:00
Oleg Pudeyev
6ae5a64f6c [feature/template-engine] Fixed absolute path PHP includes, added test.
PHPBB3-9726
2011-05-19 12:18:16 -04:00
Oleg Pudeyev
efda4da19f [feature/template-engine] Moved includephp test to its own file.
PHPBB3-9726
2011-05-18 10:57:04 -04:00
Oleg Pudeyev
f24d858cff [feature/template-engine] Added tests for template inheritance.
PHPBB3-9726
2011-05-18 10:51:33 -04:00
Oleg Pudeyev
20b4df2853 [feature/template-engine] Delete useless template require.
It is now handled by autoloading.

PHPBB3-9726
2011-05-18 10:36:17 -04:00
Oleg Pudeyev
be8fc0864c [feature/template-engine] Added a test for inclusion of php files from subdir.
PHPBB3-9726
2011-05-14 15:30:20 -04:00
Oleg Pudeyev
94560d7086 [feature/template-engine] Make INCLUDEPHP relative to board root.
PHPBB3-9726
2011-05-12 20:13:32 -04:00
Oleg Pudeyev
d2ac05aa74 [feature/template-engine] Replaced globals with dependency injection.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
Oleg Pudeyev
581374c9c3 [feature/template-engine] Deleted useless catch.
In tests there is no need to catch unexpected exceptions.

PHPBB3-9726
2011-05-12 20:13:31 -04:00
Oleg Pudeyev
ac9a910c64 [feature/template-engine] Delete obsolete comments pertaining to notices.
PHPBB3-9726
2011-05-12 20:13:31 -04:00
Oleg Pudeyev
0462ab3a4a [feature/template-engine] Add back IN_PHPBB preamble.
PHPBB3-9726
2011-05-12 20:13:30 -04:00
Oleg Pudeyev
87832d06cc [feature/template-engine] Delete template class, use phpbb_template instead.
PHPBB3-9726
2011-05-04 00:08:20 -04:00
Oleg Pudeyev
2aec6bb07c [feature/template-engine] Only copy files to cache if they exist.
When testing eval code path, compiled templates may not be written
to the file system, and unconditionally trying to copy them
breaks tests.

PHPBB3-9726
2011-05-01 03:12:23 -04:00
Oleg Pudeyev
b884573c1d [feature/template-engine] Relax missing file exception check.
As long as the exception message has the correct description and
file name we should not care which function raised the exception.

PHPBB3-9726
2011-05-01 03:11:13 -04:00
Igor Wiedler
427a5122d5 [feature/template-engine] Fix negative variable expressions
compile_tag_if had the flawed approach of adding an isset statement for
all variables to the beginning of the if. This fails for negative
expressions, and checking those takes a considerable effort.

The easier solution is to make the variable expression itself
conditional, defaulting to null if it is not set.

Thanks to naderman for the solution.

PHPBB3-9726
2011-04-25 23:19:36 -04:00
Oleg Pudeyev
f0b97cfdcf [feature/template-engine] Added a test for reuse of loop identifiers.
This currently does not pass, thus it is commented out.

The reuse appears implausible in the same file, however it may be
also done across template files where it is much harder to detect.

PHPBB3-9726
2011-04-25 23:19:32 -04:00
Oleg Pudeyev
f97411b911 [feature/template-engine] Corrected miscompilation of loop size constructs.
PHPBB3-9726
2011-04-25 23:19:25 -04:00
Oleg Pudeyev
5afc0b9b90 [feature/template-engine] Corrected an off-by-one error in nested namespaces.
This error resulted in a dot from the namespace being placed into
variable reference in compiled template code, thus creating bogus
compiled template code.

PHPBB3-9726
2011-04-24 23:13:13 -04:00
Oleg Pudeyev
e10d62badc [feature/template-engine] Added a test for multilevel references in loops.
This currently fails.

This test is a reduced version of permission_mask template in acp, which
is not correctly compiled by the current template engine code.

PHPBB3-9726
2011-04-24 21:56:26 -04:00
Oleg Pudeyev
5c3ebb3465 [feature/template-engine] Deleted silencing of notices.
The code is now supposed to be notice-free, therefore there is no need
to have the notices silenced.

PHPBB3-9726
2011-04-24 21:22:43 -04:00
Oleg Pudeyev
a2c75f6053 [feature/template-engine] Deleted $template from phpbb_template_compile class.
phpbb_template_compile is now much simpler. It takes complete file paths
as inputs, either source template path or source template path and output
compiled template path. The number of methods also went down to two -
compile template and returned compiled text or compile and write to file.

phpbb_compile class is responsible for determining source and compiled
paths. It already had all the data necessary for this, now the code is
in the same place as the data it uses.

PHPBB3-9726
2011-04-24 21:18:18 -04:00
Oleg Pudeyev
f29f32e0d6 [feature/template-engine] Allow leading underscores in variable names.
Subsilver uses ._file in overall_header.

PHPBB3-9726
2011-04-24 01:08:48 -04:00
Oleg Pudeyev
203187a841 [feature/template-engine] Fix recompilation logic.
Do not change $recompile from true to false - any recompilation
condition alone is sufficient to force recompilation.

Also uncomment the nonexistent file test which passes with this fix.

PHPBB3-9726
2011-04-24 01:08:48 -04:00
Oleg Pudeyev
4dfe4c7f13 [feature/template-engine] Adjust path in includephp template.
Now that tests are run from top level the '..' is wrong.

PHPBB3-9726
2011-04-24 01:08:30 -04:00
Marek A. Ruszczynski
4b646c6c80 [feature/template-engine] Update tests.
PHPBB3-9726
2011-04-23 22:48:50 -04:00
Marek A. Ruszczynski
b835f364f5 [ticket/10081] remove $phpEx.
PHPBB3-10081
2011-03-07 18:50:18 +01:00
Marek A. Ruszczynski
7147382e9e [ticket/10081] Cleanup Template Tests.
There are no incomplete template tests anymore.

PHPBB3-10081
2011-03-07 18:26:46 +01:00
Erik Frèrejean
14891cdf4e [ticket/10011] Tests don't work on PHP < 5.3
Due to the usage of `__DIR__` for the file includes the tests can't
be ran on systems with PHP < 5.3. Replace all occurances of
`__DIR__` with `dirname(__FILE__)`.

PHPBB3-10011
2011-01-31 12:58:18 +01:00
Igor Wiedler
01fe91c5c4 [ticket/9987] Rename test files to include a _test suffix
PHPBB3-9987
2011-01-10 00:18:37 +01:00
Igor Wiedler
69616db1ed [ticket/9981] Fix unit test dependencies
PHPBB3-9981
2011-01-07 22:45:39 +01:00
Igor Wiedler
9a52bd0301 [task/phpunit-xml] Use phpunit.xml for test suite
PHPBB3-9967
2011-01-04 22:54:01 +01:00
Nils Adermann
9b4da98653 [task/mssql-db-tests] PHPUnit output got stuck after unterminated ob_start.
PHPBB3-9868
2010-10-25 19:43:39 +02:00
Nils Adermann
bbc3105466 [ticket/9701] Prevent notices from being hidden by template tests
The template tests disable NOTICEs for the duration of template execution since
the current version of the template engine does not generate sufficiently clean
code. The error level is reset aftwards, however that part is skipped when
trigger_error is called which is converted into a regular exception by PHPUnit
and passed down until caught. Such exceptions are now caught to reset the error
level, and then the exception is rethrown.

This uncovered another issue in the template tests which only passed because
NOTICEs were unintentionally disabled at this point. assign_display is also
required to operate without NOTICEs. The respective code has been added around
its callee as well. However no handling of exceptions takes place there. If
another test checking for errors in that function is ever added similar catch
logic will have to be added there.

PHPBB3-9701
2010-07-08 22:46:28 +02:00