There is a phpbb_config class which simply holds an array and does not persist
any data. It implements ArrayAccess, Countable and IteratorAggregate to allow
regular use of configuration as if it was still an array. The phpbb_config_db
class depends on an instance of the dbal and a cache driver. It obtains the
configuration data from cache and database as necessary and persists data to
the database.
The functions set_config and set_config_count remain for backward compatability
but they only call methods on the new config class now instead of directly
manipulating the database and cache.
PHPBB3-9988
They are now refered to as cache drivers rather than ACM classes. The
additional utility functions from the original cache class have been
moved to the cache_service. The class loader is now instantiated without
a cache instance and passed one as soon as it is constructed to allow
autoloading the cache classes.
PHPBB3-9983
* develop-olympus:
[ticket/9933] Create unit test for word censor regular expression.
[ticket/9933] Move word censor regex into separate function in functions.php
[ticket/9933] Wrong handling consecutive multiple asterisks in word censor
Conflicts:
phpBB/includes/cache.php
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
The blacklisting of these static variables is necessary because code coverage
will otherwise consume too much memory. The problem did not exist in earlier
PHPUnit versions because all classes beginning with PHPUnit are automatically
blacklisted, and code coverage as well as a few other internal classes were
still internal parts of PHPunit. These were now moved to PHP_ namespace,
causing the problem with backupStaticAttributes.
PHPBB3-9967
* feature/igorw/request-class:
[feature/request-class] Convert some remaining cookies
[feature/request-class] Adjust misleading comment
[feature/request-class] Remove direct access to _REQUEST in acp_search
[feature/request-class] Special case of direct access to _REQUEST
Closing tags converted using Oleg's script.
remove-php-end-tags.py -a .
Trailing newlines added using the following where $ext is file extension.
find . -type f -name "*.$ext" -print | xargs printf "e %s\nw\n" | ed -s;
Extensions: php, css, html, js, xml.
PHPBB3-9556
* develop-olympus:
[task/mssql-db-tests] Remove MS SQL helper values from SELECT LIMIT results.
[task/mssql-db-tests] Split up database tests into SELECT and write operations
[task/mssql-db-tests] PHPUnit output got stuck after unterminated ob_start.
[task/mssql-db-tests] sql_query_limit must return all results when total = 0
[task/mssql-db-tests] Add support for odbc & sqlsrv PDO test connections
[task/mssql-db-tests] Refactored getConnection into multiple smaller parts.
[task/mssql-db-tests] Allow test configuration with environment variables.
[task/mssql-db-tests] No longer display an error when skipping db tests.
[task/mssql-db-tests] Use a simple getter for test case helpers.
Conflicts:
tests/template/template.php
To allow execution of the tests with different configurations without having
to use the test_config.php file, environment variables of the form
PHPBB_TEST_<name> can now be used, e.g. PHPBB_TEST_DBMS to set the variables
otherwise expected in test_config.php
PHPBB3-9868
Tests are run with sqlite by default now anyway, so in the majority of cases
the error message explaining how to set up database test running will not be
displayed anyway. Database tests are now generally simply skipped if no
configuration can be found. The RUNNING_TESTS.txt file explains how to set
them up however, and more info is available on the wiki.
The get_database_config method was moved from test_case_helpers to
database_test_case because it has no general purpose.
PHPBB3-9868
Calling initialisation to then use the member directly seems more
complicated than just having a method that returns the instance or
creates it if necessary.
PHPBB3-9868
All class names have been adjusted to use a phpbb_request prefix,
allowing them to be autoloaded.
Also introduces some improvements to autoloading in general.
PHPBB3-9716
Removed the dependency of the request class test on having an actual
phpbb_type_cast_helper instance, by replacing it with an object mocking
the phpbb_type_cast_helper_interface.
PHPBB3-9716
The request class
- now makes use of the new type cast helper (dependency injection)
- has no static methods anymore.
- now has a constructor argument to leave super globals turned on
Brought back the set_var function in functions.php. It is now a wrapper
around the type cast helper. It creates an instance on the fly.
The request_var wrapper function now has an optional last argument to
inject the request class instance, rather than abusing the $var_name.
PHPBB3-9716
These methods should be available without having to instantiate a request class
object, better separation of concerns. A set_var wrapper around this class no
longer requires a request object at all.
PHPBB3-9716
The well known request_var function is now a wrapper that calls a method
on a phpbb_request object. The class provides additional functionality.
It can replace all super globals with special objects that throw errors
when being accessed. They still allow isset operations to keep backward
compatibility with isset($_POST['var']) checks. The phpbb_request class
implements the phpbb_request_interface which is available for easy mocking
of input in tests.
PHPBB3-9716
* develop-olympus:
[ticket/9825] Add unit test config and db to gitignore
[ticket/9825] Unit tests: Use sqlite when possible and no test_config exists.
* develop-olympus:
[ticket/9592] Slight adjustments to simplify db test cases
[ticket/9592] Remove test cases for empty IN()
[ticket/9592] Test suite does not run on SQlite
* 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