Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
Documentation
Docs
Developer Documentation
Commits
bc65f652
Commit
bc65f652
authored
7 years ago
by
Sean Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Small markdown improvements
parent
19474d77
No related branches found
Branches containing commit
No related tags found
1 merge request
!252
Update phpunit.md to reflect discussions on chat.civicrm.org
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/testing/phpunit.md
+6
-2
6 additions, 2 deletions
docs/testing/phpunit.md
with
6 additions
and
2 deletions
docs/testing/phpunit.md
+
6
−
2
View file @
bc65f652
...
@@ -14,15 +14,17 @@ with [buildkit](/tools/buildkit.md).
...
@@ -14,15 +14,17 @@ with [buildkit](/tools/buildkit.md).
local database to be used for testing, and will leave it unusable afterwards.
local database to be used for testing, and will leave it unusable afterwards.
To check that everything is configured correctly:
To check that everything is configured correctly:
```
bash
```
bash
$
cd
/path/to/civicrm
$
cd
/path/to/civicrm
$
cv vars:show
$
cv vars:show
```
```
Check that
```CIVI_DB_DSN```
and
```TEST_DB_DSN```
is configured. If you installed
Check that
`CIVI_DB_DSN`
and
`TEST_DB_DSN`
is configured. If you installed
using buildkit this should all be configured for you.
using buildkit this should all be configured for you.
If you want to run unit tests (and not WebTests or E2E tests) set the
If you want to run unit tests (and not WebTests or E2E tests) set the
environment variable
`CIVICRM_UF`
to "UnitTests" (eg. in civicrm.settings.test.php above). This can also be set using the
environment variable
`CIVICRM_UF`
to "UnitTests" (eg. in
`
civicrm.settings.test.php
`
above). This can also be set using the
`env`
command to change the environment just for a single command.
`env`
command to change the environment just for a single command.
!!! warning
!!! warning
...
@@ -39,7 +41,9 @@ test if necessary.
...
@@ -39,7 +41,9 @@ test if necessary.
$
cd
/path/to/civicrm
$
cd
/path/to/civicrm
$
env
CIVICRM_UF
=
UnitTests phpunit4 ./tests/phpunit/CRM/AllTests.php
$
env
CIVICRM_UF
=
UnitTests phpunit4 ./tests/phpunit/CRM/AllTests.php
```
```
or to run an individual test you could run:
or to run an individual test you could run:
```
```
$ env CIVICRM_UF=UnitTests phpunit4 ./tests/phpunit/api/v3/CaseTest.php --filter testCaseCreate
$ env CIVICRM_UF=UnitTests phpunit4 ./tests/phpunit/api/v3/CaseTest.php --filter testCaseCreate
```
```
...
...
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