Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
eb3744f4
Valider
eb3744f4
rédigé
10 years ago
par
Thomas Steur
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
refs #6635 updated instructions
parent
a195b37f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
tests/README.md
+4
-25
4 ajouts, 25 suppressions
tests/README.md
avec
4 ajouts
et
25 suppressions
tests/README.md
+
4
−
25
Voir le fichier @
eb3744f4
...
@@ -42,34 +42,13 @@ To execute the tests:
...
@@ -42,34 +42,13 @@ To execute the tests:
## PHPUnit Tests
## PHPUnit Tests
1.
To install PHPUnit, run
`php composer.phar
update
`
in the Piwik root directory.
1.
To install PHPUnit, run
`php composer.phar
install --dev
`
in the Piwik root directory.
Add the PHPUnit binary path to the your PATH environment variable. For example on Linux:
2.
Ensure the
`[database_tests]`
section in
`piwik/config/config.php.ini`
is set up correctly,
Edit `.bashrc` in your home directory and add the following line:
export PATH=/path/to/dir:$PATH
You will need to source your `.bashrc` or logout/login (or restart the terminal) for the changes to take effect.
To source your `.bashrc`, in your home directory simply type
$ source .bashrc
See [PHPUnit doc](http://www.phpunit.de/manual/current/en/installation.html).
Note: if you were already using PHPUnit using PEAR, you may delete the PEAR PHPUnit with `sudo rm /usr/bin/phpunit`
2.
Configure PHPUnit: Copy the file
`piwik/tests/PHPUnit/phpunit.xml.dist`
to
`phpunit.xml`
.
In this file, you will find the following lines.
Please edit HTTP_HOST and REQUEST_URI to match the hostname and path of the Piwik files.
For example if your Piwik is available at http://localhost/path/to/piwik/ you would write:
<server name="HTTP_HOST" value="localhost"/>
<server name="REQUEST_URI" value="/path/to/piwik/"/>
3.
Ensure the
`[database_tests]`
section in
`piwik/config/config.php.ini`
is set up correctly,
i.e. with the correct password to prevent the following error:
i.e. with the correct password to prevent the following error:
`SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)`
`SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)`
4
.
Run the tests
3
.
Run the tests
$ cd /path/to/piwik
$ cd /path/to/piwik
$ ./console tests:run --testsuite unit
$ ./console tests:run --testsuite unit
...
@@ -87,7 +66,7 @@ To execute the tests:
...
@@ -87,7 +66,7 @@ To execute the tests:
To execute multiple groups you can separate them via a comma:
To execute multiple groups you can separate them via a comma:
`./console tests:run CustomAlerts,Insights`. This would run all unit, integration and system tests of the CustomAlerts and Insights plugin.
`./console tests:run CustomAlerts,Insights`. This would run all unit, integration and system tests of the CustomAlerts and Insights plugin.
5
.
Write more tests :)
4
.
Write more tests :)
See
[
"Writing Unit tests with PHPUnit"
](
http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html
)
See
[
"Writing Unit tests with PHPUnit"
](
http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html
)
## How to differentiate between unit, integration or system tests?
## How to differentiate between unit, integration or system tests?
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter