1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

270 Commits

Author SHA1 Message Date
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
Joas Schilling
c71b1245ec [develop-olympus] Make this test run on windows with backslash-paths. 2010-03-26 14:46:18 +01:00
Nils Adermann
60bd1edcb5 [develop-olympus] Backported 3.1 unit tests to 3.0.
Start adding unit tests for bugs you fix! Tests for anything are
welcome really. We have to work on these a lot.
2010-03-10 16:24:19 +01:00
Nils Adermann
a0930e78c6 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10081] remove $phpEx.
  [ticket/10081] Cleanup Template Tests.
2011-03-07 19:10:19 +01:00
Andreas Fischer
d06657c995 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10011] Tests don't work on PHP < 5.3

Conflicts:
	tests/security/redirect_test.php
2011-01-31 13:26:20 +01:00
Igor Wiedler
b5c8349f4a Merge branch 'develop-olympus' into develop
This merge commit includes ascraeus-specific renames and adjustments.
2011-01-10 00:37:47 +01:00
Igor Wiedler
c1950004b4 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9981] Fix unit test dependencies
2011-01-09 23:11:58 +01:00
Igor Wiedler
14a84cf89c Merge branch 'develop-olympus' into develop
This commit also ports all ascraeus tests to the new format.

Conflicts:
	tests/all_tests.php
	tests/network/all_tests.php
	tests/request/all_tests.php
	tests/request/request_var.php
	tests/template/templates/includephp.html
2011-01-07 01:39:59 +01:00
Nils Adermann
2e787fa836 Merge branch 'develop-olympus' into develop
* develop-olympus: (57 commits)
  Revert "[ticket/7716] Data too long for column 'message_subject'"
  [ticket/7716] Data too long for column 'message_subject'
  [ticket/9780] Adding unit tests for gen_rand_string().
  [ticket/9780] Add length check back to gen_rand_string().
  [ticket/7972] Copying topics in the MCP now indexes the new topic.
  [ticket/9782] Board disable radio set on when server load high
  [ticket/9635] Useless parameter $data['post_time'] in function submit_post.
  [ticket/9104] Safari does not display box headers correctly in the ACP.
  [ticket/9777] Print error message in pre-commit hook when php is not installed.
  [ticket/7716] Data too long for column 'message_subject'
  [task/git-tools] Ignore git commit message comments
  [task/git-tools] Adjust the hook to enforce that a ticket is always mentioned
  [task/git-tools] Vastly expanded commit-msg hook.
  [task/git-tools] Beginnings of a syntax checking hook.
  [task/git-tools] Append ticket identifier to commit message prior to editing.
  [ticket/7332] Redirect users back to post details when performing actions.
  [ticket/7332] Collapse post details content down to a maximum of 300px heigh
  [ticket/9771] Remove query string parameters that have no name.
  [ticket/9760] Remove unrestricted wildcards from search terms.
  [ticket/9599] Reimplement phpbb_checkdnsrr() function.
  ...

Conflicts:
	tests/template/template.php
2010-08-21 23:35:43 +02:00
Nils Adermann
d702dba75e Merge branch 'develop-olympus' into develop
* develop-olympus:
  [develop-olympus] Make this test run on windows with backslash-paths.
  [bug/56965] Redirect fails with directory traversal
  [bug/58685] Correct spelling errors in append_sid() comments.
  [bug/58025] Search robots are now redirected if they send a SID in the request
2010-03-26 18:28:48 +01:00
Nils Adermann
d1e8f6a0d3 [develop] Failed to merge the template test properly.
The feature branch for the new template engine should probably
contain all the deleted tests as well. We should look into the
incompatibilities and try to stay backwards compatible.
2010-03-10 16:48:06 +01:00
Nils Adermann
2ed9d7878e Merge branch 'develop-olympus' into develop
Conflicts:
	tests/all_tests.php
	tests/request/all_tests.php
	tests/request/request_var.php
	tests/security/all_tests.php
	tests/security/extract_current_page.php
	tests/security/redirect.php
	tests/template/all_tests.php
	tests/template/template.php
	tests/template/templates/define.html
	tests/template/templates/expressions.html
	tests/template/templates/if.html
	tests/template/templates/includephp.html
	tests/template/templates/loop.html
	tests/template/templates/loop_advanced.html
	tests/template/templates/loop_vars.html
	tests/test_framework/framework.php
	tests/test_framework/phpbb_test_case.php
	tests/text_processing/all_tests.php
	tests/text_processing/make_clickable.php
	tests/utf/all_tests.php
	tests/utf/utf8_clean_string_test.php
	tests/utf/utf8_wordwrap_test.php
2010-03-10 16:43:42 +01:00
Meik Sievertsen
8243e9a372 adjust tests a little bit to let them work again in trunk (not adjusted template/bbcode yet)
git-svn-id: file:///svn/phpbb/trunk@10212 89ea8834-ac86-4346-8a33-228a782c2dd0
2009-10-05 16:15:54 +00:00