1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 04:23:38 +01:00

339 Commits

Author SHA1 Message Date
Igor Wiedler
656f18d3af Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9933] Remove empty word check.
  [ticket/9933] Add $use_unicode parameter to get_censor_preg_expression().
  [ticket/9933] Adjust word censor regex for non-unicode mode.

Conflicts:
	phpBB/includes/functions.php

Also remove static $unicode_support.
2011-01-16 20:37:39 +01:00
Andreas Fischer
97be6e7946 [ticket/9933] Add $use_unicode parameter to get_censor_preg_expression().
Rename $unicode to $unicode_support, pass in $use_unicode defaulting to true.

In unit tests we can now pass in $use_unicode as false and also test the code
path that is taken when PCRE does not support unicode.

PHPBB3-9933
2011-01-16 20:13:05 +01:00
Nils Adermann
bdac86777e Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9990] Add docs for running slow tests
  [ticket/9990] Integrate utf normalizer tests into test suite

Conflicts:
	phpunit.xml.dist
2011-01-12 03:00:45 +01:00
Igor Wiedler
42cf9a9895 [ticket/9990] Add docs for running slow tests
PHPBB3-9990
2011-01-12 02:22:37 +01:00
Nils Adermann
129d3c53bc [task/config-class] Correctly merge cached config with dynamically loaded data.
PHPBB3-9988
2011-01-12 00:21:12 +01:00
Igor Wiedler
106f6800d4 [task/config-class] Fix db config constructor param order
PHPBB3-9988
2011-01-11 19:38:10 +01:00
Igor Wiedler
e00c5544d2 [ticket/9990] Integrate utf normalizer tests into test suite
PHPBB3-9990
2011-01-11 01:06:01 +01:00
Nils Adermann
fb2642bbc6 [task/config-class] Implemented a config class to replace the global array.
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
2011-01-10 04:05:23 +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
01fe91c5c4 [ticket/9987] Rename test files to include a _test suffix
PHPBB3-9987
2011-01-10 00:18:37 +01:00
Nils Adermann
1aef7eb20e [task/acm-refactor] Cleaning up left over mentions of ACM and fixing tests.
PHPBB3-9983
2011-01-09 23:49:44 +01:00
Igor Wiedler
9329b16ab1 [task/acm-refactor] Refactor the ACM classes to have a common interface.
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
2011-01-09 23:49:35 +01:00
Igor Wiedler
36e95f939d [ticket/9979] Support autoloading in unit tests
PHPBB-9979
2011-01-09 23:48:40 +01:00
Igor Wiedler
7129531bc0 [ticket/9981] Fix unit test dependencies
PHPBB3-9981
2011-01-09 23:48:39 +01:00
Igor Wiedler
69616db1ed [ticket/9981] Fix unit test dependencies
PHPBB3-9981
2011-01-07 22:45:39 +01:00
Andreas Fischer
1c95101284 Merge branch 'develop-olympus' into develop
* 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
2011-01-07 15:58:10 +01:00
rxu
95cf47c4ef [ticket/9933] Create unit test for word censor regular expression.
PHPBB3-9933
2011-01-07 15:32:42 +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
b48b909773 [task/phpunit-xml] Manually blacklisting a few PHPUnit classes from backups.
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
2011-01-07 01:07:30 +01:00
Nils Adermann
b720edb05b [task/phpunit-xml] Force error reporting level E_ALL | ~E_DEPRECATED.
PHPBB3-9967
2011-01-07 00:19:00 +01:00
Igor Wiedler
9a52bd0301 [task/phpunit-xml] Use phpunit.xml for test suite
PHPBB3-9967
2011-01-04 22:54:01 +01:00
Marek A. Ruszczyński
2aa54bb156 [ticket/9746] Added PHP implementation of inet_pton and inet_ntop.
PHPBB3-9746
2011-01-03 00:09:51 +01:00
Andreas Fischer
fdb5c2c990 [ticket/9746] Adding unit tests for inet_ntop() and inet_pton().
PHPBB3-9746
2011-01-03 00:09:51 +01:00
Andreas Fischer
dc7e3550ab [ticket/9746] Adding tests for phpbb_ip_normalise().
PHPBB3-9746
2011-01-03 00:09:40 +01:00
Andreas Fischer
442fc61be7 Merge branch 'feature/igorw/request-class' into develop
* 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
2010-12-16 02:22:17 +01:00
Igor Wiedler
af5b9a9640 [ticket/9556] Drop php closing tags, add trailing newline
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
2010-11-11 19:10:55 +01:00
Andreas Fischer
f164906d77 Merge branch 'develop-olympus' into develop
* 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
2010-11-03 11:58:48 +01:00
Nils Adermann
fa8dca2400 [task/mssql-db-tests] Split up database tests into SELECT and write operations
SELECT is based on the user table fixture, write (INSERT/UPDATE/DELETE) is
tested using the config table fixture.

PHPBB3-9868
2010-10-25 19:43:39 +02: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
801f66b4a2 [task/mssql-db-tests] Add support for odbc & sqlsrv PDO test connections
PHPBB3-9868
2010-10-25 19:43:18 +02:00
Nils Adermann
832035f744 [task/mssql-db-tests] Refactored getConnection into multiple smaller parts.
This is a first step to simplify the extraction of database specific code
parts into separate classes.

PHPBB3-9868
2010-10-25 19:40:11 +02:00
Nils Adermann
a397f81a2b [task/mssql-db-tests] Allow test configuration with environment variables.
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
2010-10-25 19:39:12 +02:00
Nils Adermann
9dbbfea5fd [task/mssql-db-tests] No longer display an error when skipping db tests.
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
2010-10-25 19:38:58 +02:00
Nils Adermann
ee846c461c [task/mssql-db-tests] Use a simple getter for test case helpers.
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
2010-10-25 19:38:35 +02:00
Andreas Fischer
0f49e52940 [ticket/9627] Prefix function names with 'phpbb_'.
PHPBB3-9627
2010-10-23 18:06:46 +02:00
Andreas Fischer
afda5e2073 [ticket/9627] Adding unit tests for http_byte_range().
PHPBB3-9627
2010-10-23 18:04:17 +02:00
Andreas Fischer
5f034c0a0a [ticket/9627] Adding download unit tests.
PHPBB3-9627
2010-10-23 18:04:17 +02:00
Igor Wiedler
6213188280 Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9855] Do not include the PHPUnit Framework manually on 3.5+.
  [ticket/9855] Make tests run under PHPUnit 3.5.
2010-10-17 23:36:34 +02:00
Nils Adermann
d56bf3b060 [ticket/9855] Do not include the PHPUnit Framework manually on 3.5+.
PHPBB3-9855
2010-10-17 23:32:57 +02:00
Nils Adermann
e195c91b1d [ticket/9855] Make tests run under PHPUnit 3.5.
PHPBB3-9855
2010-10-17 23:10:49 +02:00
Igor Wiedler
de5ef675ac [feature/request-class] Adjust misleading comment
PHPBB3-9716
2010-10-17 13:56:15 +02:00
Igor Wiedler
684914e635 [feature/request-class] Make additional request test cases run
PHPBB3-9716
2010-09-30 22:18:35 +02:00
Igor Wiedler
55808e11c9 [feature/request-class] Prevent recursive_set_var from applying htmlspecialchars twice
PHPBB3-9716
2010-09-19 15:31:00 +02:00
Igor Wiedler
456de63912 [feature/request-class] Refactor request classes to use autoloading
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
2010-09-17 14:08:14 +02:00
Nils Adermann
0ae7df8a51 [feature/request-class] Request class test now uses a type cast helper mock.
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
2010-09-17 14:03:47 +02:00
Nils Adermann
ea919ad8b2 [feature/request-class] Refactored request class and wrapper functions.
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
2010-09-17 14:00:01 +02:00
Nils Adermann
85b6d3b9a1 [feature/request-class] Extracted type casting helpers from the request class.
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
2010-09-17 14:00:01 +02:00
Nils Adermann
cf3f0f825a [feature/request-class] New request class supports recursive arrays.
So we can enable this old 3 level deep array input entry in
the request_var data provider, it is now also supported!

PHPBB3-9716
2010-09-17 13:50:25 +02:00
Nils Adermann
d7e52ee0f8 [feature/request-class] Adding a request class based on ascraeus-experiment.
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
2010-09-17 13:50:09 +02:00
Igor Wiedler
2376f07741 Merge branch 'develop-olympus' into develop
* 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.
2010-09-16 23:17:52 +02:00