From fe4bfd02a3f3b178130c7a8d8bcf66a4ab1c67d4 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 23 Jun 2013 21:37:54 +0530 Subject: [PATCH 1/5] [ticket/10838] Updated RUNNING_TESTS.md PHPBB3-10838 --- tests/RUNNING_TESTS.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index 26a93f0430..bde1455855 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -114,6 +114,42 @@ only want the slow tests, run: $ phpBB/vendor/bin/phpunit --group slow +Functional tests +----------------- + +Functional tests test software the way a user would. They simulate a user +browsing the website, but they do these steps in an automated way. +phpBB allows you to write such tests. This document will tell you how. + +Running +======= + +Running the tests requires your phpBB3 repository to be accessible through a +local web server. As of PHP 5.4 a builtin webserver is available. If you are +on PHP 5.3 you will also need to supply the URL to a webserver of your own in +the 'tests/test_config.php' file. This is as simple as defining the +'$phpbb_functional_url', which contains the URL for the directory containing +the board. Make sure you include the trailing slash. Testing makes use of a +seperate database defined in this config file and before running the tests +each time this database is deleted. Note that without extensive changes to the +test framework, you cannot use a board outside of the repository on which to +run tests. + + $phpbb_functional_url = 'http://localhost/phpBB3/'; + +On PHP 5.4 you do not need the $phpbb_functional_url parameter but you can +configure the port the builtin webserver runs on using + + $phpbb_functional_port = 8000; + +To then run the tests, you run PHPUnit, but use the phpunit.xml.functional +config file instead of the default one. Specify this through the "-c" option: + + phpunit -c phpunit.xml.functional + +This will change your board's config.php file, but it makes a backup at +config_dev.php, so you can restore it after the test run is complete. + More Information ================ From 5ed4dbb5b7aa4a0a00560eb7f3226d81ce54eca5 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 23 Jun 2013 22:40:55 +0530 Subject: [PATCH 2/5] [ticket/10838] separate database used mentioned in unit tests Separate database used for tests which is deleted each time tests are run information is added to unit tests. PHPBB3-10838 --- tests/RUNNING_TESTS.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index bde1455855..49c59fd928 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -47,9 +47,11 @@ Database Tests By default all tests requiring a database connection will use sqlite. If you do not have sqlite installed the tests will be skipped. If you wish to run the tests on a different database you have to create a test_config.php file within -your tests directory following the same format as phpBB's config.php. An -example for mysqli can be found below. More information on configuration -options can be found on the wiki (see below). +your tests directory following the same format as phpBB's config.php. Testing +makes use of a seperate database defined in this config file and before running +the tests each time this database is deleted. An example for mysqli can be +found below. More information on configuration options can be found on the +wiki (see below). Date: Thu, 27 Jun 2013 18:38:44 +0530 Subject: [PATCH 3/5] [ticket/10838] Fix missing data PHPBB3-10838 --- tests/RUNNING_TESTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index 49c59fd928..d43e503e03 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -130,7 +130,7 @@ Running the tests requires your phpBB3 repository to be accessible through a local web server. As of PHP 5.4 a builtin webserver is available. If you are on PHP 5.3 you will also need to supply the URL to a webserver of your own in the 'tests/test_config.php' file. This is as simple as defining the -'$phpbb_functional_url', which contains the URL for the directory containing +'$phpbb_functional_url' variable, which contains the URL for the directory containing the board. Make sure you include the trailing slash. Note that without extensive changes to the test framework, you cannot use a board outside of the repository on which to run tests. @@ -145,7 +145,7 @@ configure the port the builtin webserver runs on using To then run the tests, you run PHPUnit, but use the phpunit.xml.functional config file instead of the default one. Specify this through the "-c" option: - phpunit -c phpunit.xml.functional + $ phpBB/vendor/bin/phpunit -c phpunit.xml.functional This will change your board's config.php file, but it makes a backup at config_dev.php, so you can restore it after the test run is complete. From 89393e11e8e10632520dc80dab638635d773e643 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 29 Jun 2013 18:42:17 +0530 Subject: [PATCH 4/5] [ticket/10838] Remove php 5.4 and builtin server references PHPBB3-10838 --- tests/RUNNING_TESTS.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index d43e503e03..a6448c9b09 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -127,8 +127,7 @@ Running ======= Running the tests requires your phpBB3 repository to be accessible through a -local web server. As of PHP 5.4 a builtin webserver is available. If you are -on PHP 5.3 you will also need to supply the URL to a webserver of your own in +local web server. You will need to supply the URL to the webserver in the 'tests/test_config.php' file. This is as simple as defining the '$phpbb_functional_url' variable, which contains the URL for the directory containing the board. Make sure you include the trailing slash. Note that without extensive @@ -137,11 +136,6 @@ on which to run tests. $phpbb_functional_url = 'http://localhost/phpBB3/'; -On PHP 5.4 you do not need the $phpbb_functional_url parameter but you can -configure the port the builtin webserver runs on using - - $phpbb_functional_port = 8000; - To then run the tests, you run PHPUnit, but use the phpunit.xml.functional config file instead of the default one. Specify this through the "-c" option: From 440986dc3f941835febf75a30f41b69cb748a15a Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 29 Jun 2013 19:32:15 +0530 Subject: [PATCH 5/5] [ticket/10838] Fix URL for wiki and remove irrelevant line PHPBB3-10838 --- tests/RUNNING_TESTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/RUNNING_TESTS.md b/tests/RUNNING_TESTS.md index a6448c9b09..23c74f4411 100644 --- a/tests/RUNNING_TESTS.md +++ b/tests/RUNNING_TESTS.md @@ -121,7 +121,7 @@ Functional tests Functional tests test software the way a user would. They simulate a user browsing the website, but they do these steps in an automated way. -phpBB allows you to write such tests. This document will tell you how. +phpBB allows you to write such tests. Running ======= @@ -148,4 +148,4 @@ More Information ================ Further information is available on phpbb wiki: -http://wiki.phpbb.com/Unit_Tests +http://wiki.phpbb.com/Automated_Tests