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
d9217598
Valider
d9217598
rédigé
10 years ago
par
mattab
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Fix unit tests
parent
9c1fb09e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
plugins/SegmentEditor/Model.php
+8
-9
8 ajouts, 9 suppressions
plugins/SegmentEditor/Model.php
tests/PHPUnit/Unit/CronArchive/SegmentArchivingRequestUrlProviderTest.php
+3
-0
3 ajouts, 0 suppression
...it/CronArchive/SegmentArchivingRequestUrlProviderTest.php
avec
11 ajouts
et
9 suppressions
plugins/SegmentEditor/Model.php
+
8
−
9
Voir le fichier @
d9217598
...
@@ -18,11 +18,10 @@ use Piwik\DbHelper;
...
@@ -18,11 +18,10 @@ use Piwik\DbHelper;
class
Model
class
Model
{
{
private
static
$rawPrefix
=
'segment'
;
private
static
$rawPrefix
=
'segment'
;
private
$table
;
p
ublic
function
__construct
()
p
rotected
function
getTable
()
{
{
$this
->
table
=
Common
::
prefixTable
(
self
::
$rawPrefix
);
return
Common
::
prefixTable
(
self
::
$rawPrefix
);
}
}
/**
/**
...
@@ -33,7 +32,7 @@ class Model
...
@@ -33,7 +32,7 @@ class Model
*/
*/
public
function
getAllSegmentsAndIgnoreVisibility
()
public
function
getAllSegmentsAndIgnoreVisibility
()
{
{
$sql
=
"SELECT * FROM "
.
$this
->
t
able
.
" WHERE deleted = 0"
;
$sql
=
"SELECT * FROM "
.
$this
->
getT
able
()
.
" WHERE deleted = 0"
;
$segments
=
$this
->
getDb
()
->
fetchAll
(
$sql
);
$segments
=
$this
->
getDb
()
->
fetchAll
(
$sql
);
...
@@ -102,7 +101,7 @@ class Model
...
@@ -102,7 +101,7 @@ class Model
public
function
deleteSegment
(
$idSegment
)
public
function
deleteSegment
(
$idSegment
)
{
{
$db
=
$this
->
getDb
();
$db
=
$this
->
getDb
();
$db
->
delete
(
$this
->
t
able
,
'idsegment = '
.
(
int
)
$idSegment
);
$db
->
delete
(
$this
->
getT
able
()
,
'idsegment = '
.
(
int
)
$idSegment
);
}
}
public
function
updateSegment
(
$idSegment
,
$segment
)
public
function
updateSegment
(
$idSegment
,
$segment
)
...
@@ -110,7 +109,7 @@ class Model
...
@@ -110,7 +109,7 @@ class Model
$idSegment
=
(
int
)
$idSegment
;
$idSegment
=
(
int
)
$idSegment
;
$db
=
$this
->
getDb
();
$db
=
$this
->
getDb
();
$db
->
update
(
$this
->
t
able
,
$segment
,
"idsegment =
$idSegment
"
);
$db
->
update
(
$this
->
getT
able
()
,
$segment
,
"idsegment =
$idSegment
"
);
return
true
;
return
true
;
}
}
...
@@ -118,7 +117,7 @@ class Model
...
@@ -118,7 +117,7 @@ class Model
public
function
createSegment
(
$segment
)
public
function
createSegment
(
$segment
)
{
{
$db
=
$this
->
getDb
();
$db
=
$this
->
getDb
();
$db
->
insert
(
$this
->
t
able
,
$segment
);
$db
->
insert
(
$this
->
getT
able
()
,
$segment
);
$id
=
$db
->
lastInsertId
();
$id
=
$db
->
lastInsertId
();
return
$id
;
return
$id
;
...
@@ -127,7 +126,7 @@ class Model
...
@@ -127,7 +126,7 @@ class Model
public
function
getSegment
(
$idSegment
)
public
function
getSegment
(
$idSegment
)
{
{
$db
=
$this
->
getDb
();
$db
=
$this
->
getDb
();
$segment
=
$db
->
fetchRow
(
"SELECT * FROM "
.
$this
->
t
able
.
" WHERE idsegment = ?"
,
$idSegment
);
$segment
=
$db
->
fetchRow
(
"SELECT * FROM "
.
$this
->
getT
able
()
.
" WHERE idsegment = ?"
,
$idSegment
);
return
$segment
;
return
$segment
;
}
}
...
@@ -139,7 +138,7 @@ class Model
...
@@ -139,7 +138,7 @@ class Model
private
function
buildQuerySortedByName
(
$where
)
private
function
buildQuerySortedByName
(
$where
)
{
{
return
"SELECT * FROM "
.
$this
->
t
able
.
" WHERE
$where
ORDER BY name ASC"
;
return
"SELECT * FROM "
.
$this
->
getT
able
()
.
" WHERE
$where
ORDER BY name ASC"
;
}
}
public
static
function
install
()
public
static
function
install
()
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
tests/PHPUnit/Unit/CronArchive/SegmentArchivingRequestUrlProviderTest.php
+
3
−
0
Voir le fichier @
d9217598
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
namespace
Piwik\Tests\Unit\CronArchive
;
namespace
Piwik\Tests\Unit\CronArchive
;
use
Piwik\Config
;
use
Piwik\Date
;
use
Piwik\Date
;
use
Piwik\CronArchive\SegmentArchivingRequestUrlProvider
;
use
Piwik\CronArchive\SegmentArchivingRequestUrlProvider
;
...
@@ -21,6 +22,8 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
...
@@ -21,6 +22,8 @@ class SegmentArchivingRequestUrlProviderTest extends \PHPUnit_Framework_TestCase
public
function
setUp
()
public
function
setUp
()
{
{
Config
::
getInstance
()
->
General
[
'enabled_periods_API'
]
=
'day,week,month,year,range'
;
$this
->
mockSegmentEntries
=
array
(
$this
->
mockSegmentEntries
=
array
(
array
(
array
(
'ts_created'
=>
'2014-01-01'
,
'ts_created'
=>
'2014-01-01'
,
...
...
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