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
* ticket/bantu/9626:
[ticket/9626] Adding tests for the URL regular expression.
[ticket/9626] Add missing class prefix.
[ticket/9626] A few tests for the email regular expression.
[ticket/9626] More IPv6 regex tests.
[ticket/9626] Adding tests for the IPv4 regular expression.
[ticket/9626] Adding tests for regular expressions.
The database base test will need a few more changes to run on all the
databases we support. But those really need to be made on a system where
they run and can be tested. Patches welcome!
There is now a phpbb_database_test_case which can be used as a base class for tests that require database access. You have to set up a test_config.php file in your tests/ directory containing host, user, pass etc.
Extra test functionality has been moved to phpbb_test_case_helpers to provide the same functionality in database tests and regular tests without duplicating the code. This is achieved through delegation of method calls.