1
1
<?php
2
+
2
3
/**
3
4
* Matomo - free/libre analytics platform
4
5
*
18
19
*/
19
20
class ApiTest extends BaseTest
20
21
{
21
-
22
22
public function setUp (): void
23
23
{
24
24
parent ::setUp ();
@@ -39,17 +39,29 @@ protected function createAlert(
39
39
$ reportCondition = 'matches_exactly ' ,
40
40
41
41
$ comparedTo = 1
42
- )
43
- {
42
+ ) {
44
43
if (is_null ($ idSites )) {
45
44
$ idSites = $ this ->idSite ;
46
45
}
47
46
48
47
// those should be dropped by the api as they do not exist in Piwik
49
48
$ phoneNumbers = array ('+1234567890 ' , '1234567890 ' );
50
49
51
- $ id = $ this ->api ->addAlert ($ name , $ idSites , $ period , 0 , $ emails , $ phoneNumbers , $ metric , $ metricCondition ,
52
- $ metricMatched = 5 , $ comparedTo , $ report , $ reportCondition , 'Piwik ' );
50
+ $ id = $ this ->api ->addAlert (
51
+ $ name ,
52
+ $ idSites ,
53
+ $ period ,
54
+ 0 ,
55
+ $ emails ,
56
+ $ phoneNumbers ,
57
+ $ metric ,
58
+ $ metricCondition ,
59
+ $ metricMatched = 5 ,
60
+ $ comparedTo ,
61
+ $ report ,
62
+ $ reportCondition ,
63
+ 'Piwik '
64
+ );
53
65
return $ id ;
54
66
}
55
67
@@ -164,8 +176,7 @@ protected function assertIsAlert(
164
176
$ report = 'MultiSites_getOne ' ,
165
177
$ reportCondition = 'matches_exactly ' ,
166
178
$ reportMatched = 'Piwik '
167
- )
168
- {
179
+ ) {
169
180
if (is_null ($ idSites )) {
170
181
$ idSites = array ($ this ->idSite );
171
182
}
@@ -211,8 +222,7 @@ protected function editAlert(
211
222
$ metricCondition = 'less_than ' ,
212
223
$ reportCondition = 'matches_exactly ' ,
213
224
214
- )
215
- {
225
+ ) {
216
226
if (is_null ($ idSites )) {
217
227
$ idSites = $ this ->idSite ;
218
228
}
@@ -221,8 +231,22 @@ protected function editAlert(
221
231
$ phoneNumbers = array ('+1234567890 ' , '1234567890 ' );
222
232
$ comparedTo = 1 ;
223
233
224
- $ id = $ this ->api ->editAlert ($ id , $ name , $ idSites , $ period , 0 , $ emails , $ phoneNumbers , $ metric , $ metricCondition ,
225
- $ metricMatched = 5 , $ comparedTo , $ report , $ reportCondition , 'Piwik ' );
234
+ $ id = $ this ->api ->editAlert (
235
+ $ id ,
236
+ $ name ,
237
+ $ idSites ,
238
+ $ period ,
239
+ 0 ,
240
+ $ emails ,
241
+ $ phoneNumbers ,
242
+ $ metric ,
243
+ $ metricCondition ,
244
+ $ metricMatched = 5 ,
245
+ $ comparedTo ,
246
+ $ report ,
247
+ $ reportCondition ,
248
+ 'Piwik '
249
+ );
226
250
return $ id ;
227
251
}
228
252
@@ -571,4 +595,4 @@ public function test_getTriggeredAlerts_ShouldReturnAllThatMatchesLoginAndIdSite
571
595
$ triggeredAlerts = $ this ->api ->getTriggeredAlerts (array (1 ));
572
596
$ this ->assertCount (0 , $ triggeredAlerts );
573
597
}
574
- }
598
+ }
0 commit comments