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

79 Commits

Author SHA1 Message Date
Nils Adermann
bbf3864cb4 [task/session-tests] Correctly display message on session continue test failure
PHPBB3-9732
2011-02-27 22:16:39 +01:00
Nils Adermann
3d65c3c104 [task/session-tests] Make the session id replacement of dataset values clearer
PHPBB3-9732
2011-02-27 22:06:01 +01:00
Igor Wiedler
c8ad006b71 [ticket/10060] Fix test suite under MySQL
Regression from PHPBB3-10043, a typo caused the database tests to fail
under MySQL.

PHPBB3-10060
2011-02-25 16:37:20 +01:00
Nils Adermann
cb56ab2dbd [ticket/10052] Add comments to the session testable factory.
PHPBB3-10052
2011-02-23 22:17:12 +01:00
Nils Adermann
11262afa93 [ticket/10052] Correct session tests, and separate session factory from tests
PHPBB3-10052
2011-02-23 18:33:20 +01:00
Oleg Pudeyev
6902ecf6a9 [ticket/10049] Mark session init test incomplete for now.
This test passes by itself but fails when run as part of the
compete suite. Mark it incomplete to avoid breaking the suite.

PHPBB3-10049
2011-02-20 08:53:15 -05:00
Oleg Pudeyev
c1e198e721 [ticket/10049] Mark session continue test incomplete for now.
I am unable to find any code revision in which this test worked.
Thus to not break the entire suite I mark it incomplete.

PHPBB3-10049
2011-02-20 08:45:59 -05:00
Oleg Pudeyev
f3ab9da0e9 [ticket/10049] Globalize $_SID.
PHPBB3-10049
2011-02-19 20:54:34 -05:00
Oleg Pudeyev
26b922ac3f [ticket/10049] Chase assertResultEquals rename.
cd694e9b9dfd59c8be00a52b30db8e6c280b97a9 renamed
assertResultEquals to assertSqlResultEquals. However, since the
session tests were never executed calls in them were never
updated.

Parameter order also changed; chase that too.

PHPBB3-10049
2011-02-19 20:54:08 -05:00
Oleg Pudeyev
0cf741f343 [ticket/10049] Fixed requires in session tests and mock.
PHPBB3-10049
2011-02-19 20:40:32 -05:00
Oleg Pudeyev
1abf7ad809 [ticket/10049] Renamed session test files to proper file names.
phpunit.xml.dist specifies that only files ending in _test.php
are test files; with the old names session tests were not run
as a result.

PHPBB3-10049
2011-02-19 20:30:46 -05:00
Oleg Pudeyev
bd8e5ff79e [task/refactor-db-testcase] Further improve error messages.
PHPBB3-10043
2011-02-15 21:08:33 -05:00
Igor Wiedler
d3718bf5d4 [task/refactor-db-testcase] Do not show db password on connect error
PHPBB3-10043
2011-02-14 15:25:05 +01:00
Igor Wiedler
17b17bc939 [task/refactor-db-testcase] Improve error message of db tests
If database tests cannot be run the error message is ambigous. This
commit makes it clearer:

- whether the supplied dbms is supported by us
- which dbms are supported by us
- whether the required PDO extension is loaded

PHPBB3-10043
2011-02-14 14:48:42 +01:00
Igor Wiedler
6c7f49f561 [task/refactor-db-testcase] Refactor phpbb_database_test_case
Move most of the methods to a separate connection manager class. The
test case creates a manager to handle database creation, schema loading
and more. Most of the methods could be simplified because they can
access shared pdo, config and dbms data.

PHPBB3-10043
2011-02-14 00:24:55 +01:00
Andreas Fischer
df78a3a62d Merge branch 'ticket/nickvergessen/9949' into develop-olympus
* ticket/nickvergessen/9949:
  [ticket/9949] Unit tests for user::lang()
  [ticket/9949] $user->lang() uses last int-value to get the key not first
2011-02-07 16:30:43 +01:00
Andreas Fischer
3c04e6db97 [ticket/9949] Unit tests for user::lang()
PHPBB3-9949
2011-02-07 16:29:53 +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
Nils Adermann
cd694e9b9d [task/session-tests] Renamed assertSqlResultEquals and fixed its param order
PHPBB3-9732
2011-01-21 21:32:31 +01:00
Nils Adermann
8538561b31 [task/session-tests] Test additional combinations of session_begin.
PHPBB3-9732
2011-01-20 22:49:38 +01:00
Nils Adermann
74f537e89d [task/session-tests] Added tests for the session class.
Two first simple tests to check functionality of session_begin and
session_create.

Added a mock class for the cache as well as a subclass of session
which has its cookie handling function mocked out to avoid header
sending problems.

PHPBB3-9732
2011-01-20 22:47:48 +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
Igor Wiedler
42cf9a9895 [ticket/9990] Add docs for running slow tests
PHPBB3-9990
2011-01-12 02:22:37 +01:00
Igor Wiedler
e00c5544d2 [ticket/9990] Integrate utf normalizer tests into test suite
PHPBB3-9990
2011-01-11 01:06:01 +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
rxu
95cf47c4ef [ticket/9933] Create unit test for word censor regular expression.
PHPBB3-9933
2011-01-07 15:32:42 +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
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
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
Andreas Fischer
ac753fa853 [ticket/9825] Unit tests: Use sqlite when possible and no test_config exists.
PHPBB3-9825
2010-09-16 00:03:52 +02:00
Igor Wiedler
a4742f795e [ticket/9592] Slight adjustments to simplify db test cases
PHPBB3-9592
2010-09-15 09:50:04 +02:00
Igor Wiedler
566ddf8a4b [ticket/9592] Remove test cases for empty IN()
They failed under SQLite because SQLite accepts empty IN() syntax.

PHPBB3-9592
2010-09-12 00:51:27 +02:00
Igor Wiedler
4fd45adfc5 [ticket/9592] Test suite does not run on SQlite
PHPBB3-9592
2010-09-11 23:34:14 +02:00
Andreas Fischer
e09d6c6d71 [ticket/9780] Adding unit tests for gen_rand_string().
PHPBB3-9780
2010-08-20 21:36:56 +02:00
Andreas Fischer
4707b0c18e [ticket/9599] Adding tests for phpbb_checkdnsrr().
Tests for existing and non-existing records of the types:
MX, A, AAAA, NS, CNAME, TXT

PHPBB3-9599
2010-08-03 10:50:41 +02:00
Andreas Fischer
3e111bb41a [ticket/9599] Adding network function tests.
PHPBB3-9599
2010-08-03 10:50:41 +02:00
Andreas Fischer
da256b33d9 Merge branch 'ticket/ckwalsh/9715' into develop-olympus
* ticket/ckwalsh/9715:
  [ticket/9715] Better email regex
  [ticket/9715] Extend email unit tests
2010-07-12 01:56:00 +02:00
Andreas Fischer
d869fc9804 Merge branch 'ticket/bantu/9714' into develop-olympus
* ticket/bantu/9714:
  [ticket/9714] Use correct variable name in email regular expression tests.
2010-07-12 01:55:52 +02:00
Cullen Walsh
a0b9f7806a [ticket/9715] Extend email unit tests
Adding more email tests for a wider range of valid email formats.

PHPBB3-9715
2010-07-11 16:20:27 -07: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