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
cb3494c3
Valider
cb3494c3
rédigé
il y a 10 ans
par
Thomas Steur
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
fix and added test
parent
d3de7b6e
Aucune branche associée trouvée
Branches contenant la validation
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/PHPUnit/Unit/CommonTest.php
+20
-24
20 ajouts, 24 suppressions
tests/PHPUnit/Unit/CommonTest.php
avec
20 ajouts
et
24 suppressions
tests/PHPUnit/Unit/CommonTest.php
+
20
−
24
Voir le fichier @
cb3494c3
...
...
@@ -15,6 +15,8 @@ use Piwik\Filesystem;
/**
* @backupGlobals enabled
* @group Common
* @group Core_CommonTest
*/
class
Core_CommonTest
extends
PHPUnit_Framework_TestCase
{
...
...
@@ -96,7 +98,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
/**
* @dataProvider getInputValues
* @group Core
*/
public
function
testSanitizeInputValues
(
$input
,
$output
)
{
...
...
@@ -113,7 +114,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
/**
* emptyvarname => exception
* @group Core
*/
public
function
testGetRequestVarEmptyVarName
()
{
...
...
@@ -128,7 +128,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
/**
* nodefault Notype Novalue => exception
* @group Core
*/
public
function
testGetRequestVarNoDefaultNoTypeNoValue
()
{
...
...
@@ -142,7 +141,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
/**
* nodefault Notype WithValue => value
* @group Core
*/
public
function
testGetRequestVarNoDefaultNoTypeWithValue
()
{
...
...
@@ -151,24 +149,33 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
}
public
function
testGetRequestVar_GetStringFloatGiven
()
{
$_GET
[
'test'
]
=
1413.431413
;
$value
=
Common
::
getRequestVar
(
'test'
,
null
,
'string'
);
$this
->
assertEquals
(
'1413.431413'
,
$value
);
}
public
function
testGetRequestVar_GetStringIntegerGiven
()
{
$_GET
[
'test'
]
=
1413
;
$value
=
Common
::
getRequestVar
(
'test'
,
null
,
'string'
);
$this
->
assertEquals
(
'1413'
,
$value
);
}
/**
* nodefault Withtype WithValue => exception cos type not matching
* @group Core
* @expectedException \Exception
* @expectedExceptionMessage The parameter 'test' isn't set in the Request
*/
public
function
testGetRequestVarNoDefaultWithTypeWithValue
()
{
try
{
$_GET
[
'test'
]
=
1413.431413
;
Common
::
getRequestVar
(
'test'
,
null
,
'string'
);
}
catch
(
Exception
$e
)
{
return
;
}
$this
->
fail
(
'Expected exception not raised'
);
$_GET
[
'test'
]
=
false
;
Common
::
getRequestVar
(
'test'
,
null
,
'string'
);
}
/**
* nodefault Withtype WithValue => exception cos type not matching
* @group Core
*/
public
function
testGetRequestVarNoDefaultWithTypeWithValue2
()
{
...
...
@@ -246,9 +253,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
}
}
/**
* @group Core
*/
public
function
testIsValidFilenameValidValues
()
{
$valid
=
array
(
...
...
@@ -263,9 +267,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
}
}
/**
* @group Core
*/
public
function
testIsValidFilenameNotValidValues
()
{
$notvalid
=
array
(
...
...
@@ -426,7 +427,6 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
/**
* @dataProvider getLanguageDataToExtractLanguageRegionCode
* @group Core
*/
public
function
testExtractLanguageAndRegionCodeFromBrowserLanguage
(
$browserLanguage
,
$validLanguages
,
$expected
)
{
...
...
@@ -461,16 +461,12 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
/**
* @dataProvider getLanguageDataToExtractLanguageCode
* @group Core
*/
public
function
testExtractLanguageCodeFromBrowserLanguage
(
$browserLanguage
,
$validLanguages
,
$expected
)
{
$this
->
assertEquals
(
$expected
,
Common
::
extractLanguageCodeFromBrowserLanguage
(
$browserLanguage
,
$validLanguages
),
"test with
{
$browserLanguage
}
failed, expected
{
$expected
}
"
);
}
/**
* @group Core
*/
public
function
testSearchEnginesDefinedCorrectly
()
{
include
"DataFiles/SearchEngines.php"
;
...
...
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