Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
7a7b77ef
Commit
7a7b77ef
authored
10 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
some updates on phpunit docs and settings
parent
4dbf4add
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_test/README
+19
-37
19 additions, 37 deletions
_test/README
_test/phpunit.xml
+4
-1
4 additions, 1 deletion
_test/phpunit.xml
with
23 additions
and
38 deletions
_test/README
+
19
−
37
View file @
7a7b77ef
...
...
@@ -9,35 +9,28 @@ This is the test suite to automatically test various parts of DokuWiki.
===== PHPUnit Installation ======
==== via PEAR installer ====
You can install phpunit through your distribution's package manager or simply
download the newest phar file into the _test directory:
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
==== via Composer ====
Include a composer.json file in your project, which can be as minimal as:
<code>
{
"require-dev": {
"phpunit/phpunit": "3.7.*"
}
}
</code>
==== via PHP archive (PHAR) ====
Download http://pear.phpunit.de/get/phpunit.phar and make it executable on your system.
cd _test/
wget https://phar.phpunit.de/phpunit.phar
===== Running all tests =====
Just change to the ''_test'' directory and run phpunit:
Just change to the ''_test'' directory and run phpunit (depending on your install
method):
cd _test/
phpunit
or
cd _test/
php phpunit.phar
===== Troubleshooting =====
PHPUnit will fail on some systems with a //headers already sent// error.
This is a known problem with PHPUnit, the error can be avoided by passing the
'--stderr' flag to phpunit:
...
...
@@ -46,8 +39,10 @@ This is a known problem with PHPUnit, the error can be avoided by passing the
On windows you may have to enable OpenSSL support for https tests.
Some of them point to httpclient_http.tests.php on the failure.
To enable HTTPS support copy the ''libeay32.dll'' and ''ssleay32.dll'' to your ''windows\system32'' folder
and add the following line to your php.ini in the extension section:
To enable HTTPS support copy the ''libeay32.dll'' and ''ssleay32.dll''
to your ''windows\system32'' folder and add the following line to your php.ini
in the extension section:
<code ini>
extension=php_openssl.dll
</code>
...
...
@@ -56,13 +51,13 @@ extension=php_openssl.dll
You can run a single test file by providing it as an argument to phpunit:
phpunit
--stderr
tests/inc/common_cleanText.test.php
phpunit tests/inc/common_cleanText.test.php
You can also use groups to exclude certain test from running. For example use
the following command to avoid long running test or tests accessing the
Internet.
phpunit
--stderr
--exclude-group slow,internet
phpunit --exclude-group slow,internet
===== Create new Tests =====
...
...
@@ -71,23 +66,10 @@ folder. Please respect the folder structure and naming convention. Inside the
file, implement a class, extending 'DokuWikiTest'. Every method, starting
with 'test' will be called as a test (e.g. 'testIfThisIsValid');
===== TODO for the test framework =====
* test cross platform compatibility: especially test windows
* update http://www.dokuwiki.org/devel:unittesting
* optional: add helper methods to TestRequest for easy form submission
* createForm(), ...
* check PHP Unit test_helpers https://github.com/sebastianbergmann/php-test-helpers
===== Migration Protocol =====
The following tests were not migrated:
* inc/indexer_idx_indexlengths (fs dependencies)
* inc/mail_send (integration test)
* inc/parser/parser_formatting
* inc/parser/xhtml_htmlphp (runkit)
* inc/parser/xhtml_links
This diff is collapsed.
Click to expand it.
_test/phpunit.xml
+
4
−
1
View file @
7a7b77ef
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap=
"bootstrap.php"
convertNoticesToExceptions=
"false"
>
convertNoticesToExceptions=
"false"
colors=
"true"
stderr=
"true"
>
<testsuites>
<testsuite
name=
"DokuWiki Tests"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment