1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 20:13:22 +01:00

607 Commits

Author SHA1 Message Date
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
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
Andreas Fischer
4d5d50001d Merge branch 'develop-olympus' into develop
* 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
2010-09-15 16:05:38 +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
Igor Wiedler
9edf0d64a2 [feature/auto-loading] Add test case for phpbb_dir2 =>
includes/dir2/dir2.php

PHPBB3-9682
2010-08-31 20:30:59 +02: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
Andreas Fischer
df111373a6 Merge branch 'feature/naderman/auto-loading' into develop
* feature/naderman/auto-loading:
  [feature/auto-loading] Only check subdir if there is another name part.
2010-08-20 22:05:05 +02:00
Andreas Fischer
e09d6c6d71 [ticket/9780] Adding unit tests for gen_rand_string().
PHPBB3-9780
2010-08-20 21:36:56 +02:00
Nils Adermann
f870434222 [feature/auto-loading] Only check subdir if there is another name part.
PHPBB3-9682
2010-08-19 22:06:19 +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
Andreas Fischer
c6c4d01fe9 [ticket/9714] Use correct variable name in email regular expression tests.
PHPBB3-9714
2010-07-08 20:26:50 +02:00
Andreas Fischer
a2918fd98e Merge branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/9704] Fix minor typo in coding guidelines.
  [ticket/9690] Add forthcoming Bing Bot to list of recognized bots
  [ticket/9451] Add optional $can_upload parameter to avatar_process_user().
  [ticket/9593] A readme file for unit tests and running unit tests.
  [ticket/9570] Changed "system" to "guest" timezone in ACP, added explanation.
  [ticket/9589] Added sample nginx configuration file for phpbb.
2010-07-08 20:10:17 +02:00
Andreas Fischer
7a0b554724 Merge branch 'ticket/p/9593' into develop-olympus
* ticket/p/9593:
  [ticket/9593] A readme file for unit tests and running unit tests.
2010-07-08 20:00:26 +02:00
Oleg Pudeyev
030f9c03c6 [ticket/9593] A readme file for unit tests and running unit tests.
Added a readme file explaining prerequisites for unit tests, and how to run
unit tests.

PHPBB3-9593
2010-07-07 16:10:13 +02:00
Nils Adermann
22c3041e12 [feature/auto-loading] Added a phpBB autoloader with caching support.
phpBB class name lookups follow these rules:
 - All classes are prefixed with phpbb_
 - All classes reside in includes/ or a subdirectory thereof
 - Directories must not contain underscores
 - The class name is separated into parts by underscores, the parts
   are checked from first to last, until one is found which is not
   a directory, all remaining parts make up the file name. If no parts
   are left, the last directory name is used.

Examples:
  directory structure:
    includes/
      class_name.php
      dir/
        class_name.php
        dir.php
        subdir/
          class_name.php

  lookups:
    phpbb_class_name            -> includes/class_name.php
    phpbb_dir_class_name        -> includes/dir/class_name.php
    phpbb_dir                   -> includes/dir/dir.php
    phpbb_dir_subdir_class_name -> includes/dir/subdir/class_name.php

Optionally the class can be supplied with a cache instance, either in the
constructor or via set_cache() at a later time. This allows for the lookups to
be cached, so the directories do not have to be traveresed on every request.
This makes it necessary for the cache and its dependency to continue to be
loaded the old way - without autoloading.

The code will not be changed to use autoloading, but it will rather only be
used for new classes where applicable.

PHPBB3-9682
2010-07-05 15:40:46 +02:00
Andreas Fischer
cf1b0202da Merge branch 'develop-olympus' into develop
* develop-olympus:
  [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.
2010-06-17 18:56:52 +02:00
Andreas Fischer
876a6e4686 Merge branch 'ticket/bantu/9626' into develop-olympus
* 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.
2010-06-17 18:50:41 +02:00
Andreas Fischer
478f8052ff Merge branch 'develop-olympus' into develop
* develop-olympus:
  [feature/dbal-tests] Follow the coding guidelines and ...
  [feature/dbal-tests] Update data
  [feature/dbal-tests] Multi insert
  [feature/dbal-tests] Delete data
  [feature/dbal-tests] Insert data
  [feature/dbal-tests] Fix SQL-ERROR: invalid input syntax for integer: ""
  [ticket/9587] Prosilver overrides reCaptcha class.
  [ticket/9605] Wrong class added to topiclist, when there's no announcement topic.
2010-06-17 16:33:48 +02:00
Joas Schilling
ef69f22698 [feature/dbal-tests] Follow the coding guidelines and ...
resolved a bug caused by a missing order-by.

PHPBB3-9625
2010-06-17 16:06:17 +02:00
Joas Schilling
e3420de295 [feature/dbal-tests] Update data
PHPBB3-9625
2010-06-17 16:06:10 +02:00
Joas Schilling
d9c2e6cbcf [feature/dbal-tests] Multi insert
PHPBB3-9625
2010-06-17 16:06:10 +02:00
Joas Schilling
c4b0814c62 [feature/dbal-tests] Delete data
PHPBB3-9625
2010-06-17 16:06:10 +02:00
Joas Schilling
539ae0ffaf [feature/dbal-tests] Insert data
PHPBB3-9625
2010-06-17 16:06:10 +02:00
Joas Schilling
b03a7a2c83 [feature/dbal-tests] Fix SQL-ERROR: invalid input syntax for integer: ""
PHPBB3-9625
2010-06-17 16:06:10 +02:00
Andreas Fischer
aaaa4f9abe [ticket/9626] Adding tests for the URL regular expression.
PHPBB3-9626
2010-05-25 12:08:52 +02:00
Andreas Fischer
646b16f5db [ticket/9626] Add missing class prefix.
PHPBB3-9626
2010-05-25 12:08:51 +02:00