Projet

Général

Profil

Paste
Télécharger (21 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / piwik / piwik.test @ d719f12f

1
<?php
2

    
3
/**
4
 * @file
5
 * Test file for Piwik module.
6
 */
7
class PiwikBasicTest extends DrupalWebTestCase {
8

    
9
  public static function getInfo() {
10
    return array(
11
      'name' => t('Piwik basic tests'),
12
      'description' => t('Test basic functionality of Piwik module.'),
13
      'group' => 'Piwik',
14
    );
15
  }
16

    
17
  function setUp() {
18
    parent::setUp('piwik');
19

    
20
    $permissions = array(
21
      'access administration pages',
22
      'administer piwik',
23
    );
24

    
25
    // User to set up piwik.
26
    $this->admin_user = $this->drupalCreateUser($permissions);
27
    $this->drupalLogin($this->admin_user);
28
  }
29

    
30
  function testPiwikConfiguration() {
31
    // Check for setting page's presence.
32
    $this->drupalGet('admin/config/system/piwik');
33
    $this->assertRaw(t('Piwik site ID'), '[testPiwikConfiguration]: Settings page displayed.');
34

    
35
    // Check for account code validation.
36
    $edit['piwik_site_id'] = $this->randomName(2);
37
    $this->drupalPost('admin/config/system/piwik', $edit, 'Save configuration');
38
    $this->assertRaw(t('A valid Piwik site ID is an integer only.'), '[testPiwikConfiguration]: Invalid Piwik site ID number validated.');
39
  }
40

    
41
  function testPiwikPageVisibility() {
42
    $ua_code = '1';
43
    variable_set('piwik_site_id', $ua_code);
44
    variable_get('piwik_url_http', 'http://example.com/piwik/');
45
    variable_get('piwik_url_https', 'https://example.com/piwik/');
46

    
47
    // Show tracking on "every page except the listed pages".
48
    variable_set('piwik_visibility_pages', 0);
49
    // Disable tracking one "admin*" pages only.
50
    variable_set('piwik_pages', "admin\nadmin/*");
51
    // Enable tracking only for authenticated users only.
52
    variable_set('piwik_roles', array(DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID));
53

    
54
    // Check tracking code visibility.
55
    $this->drupalGet('');
56
    $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed for authenticated users.');
57

    
58
    // Test whether tracking code is not included on pages to omit.
59
    $this->drupalGet('admin');
60
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is not displayed on admin page.');
61
    $this->drupalGet('admin/config/system/piwik');
62
    // Checking for tracking code URI here, as $ua_code is displayed in the form.
63
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is not displayed on admin subpage.');
64

    
65
    // Test whether tracking code display is properly flipped.
66
    variable_set('piwik_visibility_pages', 1);
67
    $this->drupalGet('admin');
68
    $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed on admin page.');
69
    $this->drupalGet('admin/config/system/piwik');
70
    // Checking for tracking code URI here, as $ua_code is displayed in the form.
71
    $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed on admin subpage.');
72
    $this->drupalGet('');
73
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is NOT displayed on front page.');
74

    
75
    // Test whether tracking code is not display for anonymous.
76
    $this->drupalLogout();
77
    $this->drupalGet('');
78
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is NOT displayed for anonymous.');
79

    
80
    // Switch back to every page except the listed pages.
81
    variable_set('piwik_visibility_pages', 0);
82
    // Enable tracking code for all user roles.
83
    variable_set('piwik_roles', array());
84

    
85
    // Test whether 403 forbidden tracking code is shown if user has no access.
86
    $this->drupalGet('admin');
87
    $this->assertRaw('"403/URL = "', '[testPiwikPageVisibility]: 403 Forbidden tracking code shown if user has no access.');
88

    
89
    // Test whether 404 not found tracking code is shown on non-existent pages.
90
    $this->drupalGet($this->randomName(64));
91
    $this->assertRaw('"404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
92
  }
93

    
94
  function testPiwikTrackingCode() {
95
    $ua_code = '2';
96
    variable_set('piwik_site_id', $ua_code);
97
    variable_get('piwik_url_http', 'http://example.com/piwik/');
98
    variable_get('piwik_url_https', 'https://example.com/piwik/');
99

    
100
    // Show tracking code on every page except the listed pages.
101
    variable_set('piwik_visibility_pages', 0);
102
    // Enable tracking code for all user roles.
103
    variable_set('piwik_roles', array());
104

    
105
    /* Sample JS code as added to page:
106
    <script type="text/javascript">
107
    var _paq = _paq || [];
108
    (function(){
109
        var u=(("https:" == document.location.protocol) ? "https://{$PIWIK_URL}" : "http://{$PIWIK_URL}");
110
        _paq.push(['setSiteId', {$IDSITE}]);
111
        _paq.push(['setTrackerUrl', u+'piwik.php']);
112
        _paq.push(['trackPageView']);
113
        var d=document,
114
            g=d.createElement('script'),
115
            s=d.getElementsByTagName('script')[0];
116
            g.type='text/javascript';
117
            g.defer=true;
118
            g.async=true;
119
            g.src=u+'piwik.js';
120
            s.parentNode.insertBefore(g,s);
121
    })();
122
    </script>
123
    */
124

    
125
    // Test whether tracking code uses latest JS.
126
    variable_set('piwik_cache', 0);
127
    $this->drupalGet('');
128
    $this->assertRaw('u+"piwik.php"', '[testPiwikTrackingCode]: Latest tracking code used.');
129

    
130
    // Test if tracking of User ID is enabled.
131
    variable_set('piwik_trackuserid', 1);
132
    $this->drupalGet('');
133
    $this->assertRaw('_paq.push(["setUserId", ', '[testPiwikTrackingCode]: Tracking code for User ID is enabled.');
134

    
135
    // Test if tracking of User ID is disabled.
136
    variable_set('piwik_trackuserid', 0);
137
    $this->drupalGet('');
138
    $this->assertNoRaw('_paq.push(["setUserId", ', '[testPiwikTrackingCode]: Tracking code for User ID is disabled.');
139

    
140
    // Test whether single domain tracking is active.
141
    $this->drupalGet('');
142
    $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: Single domain tracking is active.');
143

    
144
    // Enable "One domain with multiple subdomains".
145
    variable_set('piwik_domain_mode', 1);
146
    $this->drupalGet('');
147

    
148
    // Test may run on localhost, an ipaddress or real domain name.
149
    // TODO: Workaround to run tests successfully. This feature cannot tested reliable.
150
    global $cookie_domain;
151
    if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
152
      $this->assertRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: One domain with multiple subdomains is active on real host.');
153
    }
154
    else {
155
      // Special cases, Localhost and IP addresses don't show 'setCookieDomain'.
156
      $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: One domain with multiple subdomains may be active on localhost (test result is not reliable).');
157
    }
158

    
159
    // Test whether the BEFORE and AFTER code is added to the tracker.
160
    variable_set('piwik_codesnippet_before', '_paq.push(["setLinkTrackingTimer", 250]);');
161
    variable_set('piwik_codesnippet_after', '_paq.push(["t2.setSiteId", 2]);_gaq.push(["t2.trackPageView"]);');
162
    $this->drupalGet('');
163
    $this->assertRaw('setLinkTrackingTimer', '[testPiwikTrackingCode]: Before codesnippet has been found with "setLinkTrackingTimer" set.');
164
    $this->assertRaw('t2.trackPageView', '[testPiwikTrackingCode]: After codesnippet with "t2" tracker has been found.');
165
  }
166

    
167
}
168

    
169
class PiwikCustomVariablesTest extends DrupalWebTestCase {
170

    
171
  public static function getInfo() {
172
    return array(
173
      'name' => t('Piwik Custom Variables tests'),
174
      'description' => t('Test custom variables functionality of Piwik module.'),
175
      'group' => 'Piwik',
176
      'dependencies' => array('token'),
177
    );
178
  }
179

    
180
  function setUp() {
181
    parent::setUp('piwik', 'token');
182

    
183
    $permissions = array(
184
      'access administration pages',
185
      'administer piwik',
186
    );
187

    
188
    // User to set up piwik.
189
    $this->admin_user = $this->drupalCreateUser($permissions);
190
  }
191

    
192
  function testPiwikCustomVariables() {
193
    $ua_code = '3';
194
    variable_set('piwik_site_id', $ua_code);
195

    
196
    // Basic test if the feature works.
197
    $custom_vars = array(
198
      'slots' => array(
199
        1 => array(
200
          'slot' => 1,
201
          'name' => 'Foo 1',
202
          'value' => 'Bar 1',
203
          'scope' => 3,
204
        ),
205
        2 => array(
206
          'slot' => 2,
207
          'name' => 'Foo 2',
208
          'value' => 'Bar 2',
209
          'scope' => 2,
210
        ),
211
        3 => array(
212
          'slot' => 3,
213
          'name' => 'Foo 3',
214
          'value' => 'Bar 3',
215
          'scope' => 3,
216
        ),
217
        4 => array(
218
          'slot' => 4,
219
          'name' => 'Foo 4',
220
          'value' => 'Bar 4',
221
          'scope' => 2,
222
        ),
223
        5 => array(
224
          'slot' => 5,
225
          'name' => 'Foo 5',
226
          'value' => 'Bar 5',
227
          'scope' => 1,
228
        ),
229
      )
230
    );
231
    variable_set('piwik_custom_var', $custom_vars);
232
    $this->drupalGet('');
233

    
234
    foreach ($custom_vars['slots'] as $slot) {
235
      $this->assertRaw("_paq.push(['setCustomVariable', " . $slot['slot'] . ", \"" . $slot['name'] . "\", \"" . $slot['value'] . "\", " . $slot['scope'] . "]);", '[testPiwikCustomVariables]: setCustomVariable ' . $slot['slot'] . ' is shown.');
236
    }
237

    
238
    // Test whether tokens are replaced in custom variable names.
239
    $site_slogan = $this->randomName(16);
240
    variable_set('site_slogan', $site_slogan);
241

    
242
    $custom_vars = array(
243
      'slots' => array(
244
        1 => array(
245
          'slot' => 1,
246
          'name' => 'Name: [site:slogan]',
247
          'value' => 'Value: [site:slogan]',
248
          'scope' => 3,
249
        ),
250
        2 => array(
251
          'slot' => 2,
252
          'name' => '',
253
          'value' => $this->randomName(16),
254
          'scope' => 1,
255
        ),
256
        3 => array(
257
          'slot' => 3,
258
          'name' => $this->randomName(16),
259
          'value' => '',
260
          'scope' => 2,
261
        ),
262
        4 => array(
263
          'slot' => 4,
264
          'name' => '',
265
          'value' => '',
266
          'scope' => 3,
267
        ),
268
        5 => array(
269
          'slot' => 5,
270
          'name' => '',
271
          'value' => '',
272
          'scope' => 3,
273
        ),
274
      )
275
    );
276
    variable_set('piwik_custom_var', $custom_vars);
277
    $this->verbose('<pre>' . print_r($custom_vars, TRUE) . '</pre>');
278

    
279
    $this->drupalGet('');
280
    $this->assertRaw("_paq.push(['setCustomVariable', 1, \"Name: $site_slogan\", \"Value: $site_slogan\", 3]", '[testPiwikCustomVariables]: Tokens have been replaced in custom variable.');
281
    $this->assertNoRaw("_paq.push(['setCustomVariable', 2,", '[testPiwikCustomVariables]: Value with empty name is not shown.');
282
    $this->assertNoRaw("_paq.push(['setCustomVariable', 3,", '[testPiwikCustomVariables]: Name with empty value is not shown.');
283
    $this->assertNoRaw("_paq.push(['setCustomVariable', 4,", '[testPiwikCustomVariables]: Empty name and value is not shown.');
284
    $this->assertNoRaw("_paq.push(['setCustomVariable', 5,", '[testPiwikCustomVariables]: Empty name and value is not shown.');
285
  }
286
}
287

    
288
class PiwikStatusMessagesTest extends DrupalWebTestCase {
289

    
290
  public static function getInfo() {
291
    return array(
292
      'name' => 'Piwik status messages tests',
293
      'description' => 'Test status messages functionality of Piwik module.',
294
      'group' => 'Piwik',
295
    );
296
  }
297

    
298
  function setUp() {
299
    parent::setUp('piwik');
300

    
301
    $permissions = array(
302
      'access administration pages',
303
      'administer piwik',
304
    );
305

    
306
    // User to set up piwik.
307
    $this->admin_user = $this->drupalCreateUser($permissions);
308
  }
309

    
310
  function testPiwikStatusMessages() {
311
    $ua_code = '1';
312
    variable_set('piwik_site_id', $ua_code);
313

    
314
    // Enable logging of errors only.
315
    variable_set('piwik_trackmessages', array('error' => 'error'));
316

    
317
    $this->drupalPost('user/login', array(), t('Log in'));
318
    $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Username field is required."]);', '[testPiwikStatusMessages]: trackEvent "Username field is required." is shown.');
319
    $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Password field is required."]);', '[testPiwikStatusMessages]: trackEvent "Password field is required." is shown.');
320

    
321
    // @todo: investigate why drupal_set_message() fails.
322
    //drupal_set_message('Example status message.', 'status');
323
    //drupal_set_message('Example warning message.', 'warning');
324
    //drupal_set_message('Example error message.', 'error');
325
    //drupal_set_message('Example error <em>message</em> with html tags and <a href="http://example.com/">link</a>.', 'error');
326
    //$this->drupalGet('');
327
    //$this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testPiwikStatusMessages]: Example status message is not enabled for tracking.');
328
    //$this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testPiwikStatusMessages]: Example warning message is not enabled for tracking.');
329
    //$this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testPiwikStatusMessages]: Example error message is shown.');
330
    //$this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testPiwikStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.');
331
  }
332
}
333

    
334
class PiwikRolesTest extends DrupalWebTestCase {
335

    
336
  public static function getInfo() {
337
    return array(
338
      'name' => t('Piwik role tests'),
339
      'description' => t('Test roles functionality of Piwik module.'),
340
      'group' => 'Piwik',
341
    );
342
  }
343

    
344
  function setUp() {
345
    parent::setUp('piwik');
346

    
347
    $permissions = array(
348
      'access administration pages',
349
      'administer piwik',
350
    );
351

    
352
    // User to set up piwik.
353
    $this->admin_user = $this->drupalCreateUser($permissions);
354
  }
355

    
356
  function testPiwikRolesTracking() {
357
    $ua_code = '1';
358
    variable_set('piwik_site_id', $ua_code);
359
    variable_get('piwik_url_http', 'http://example.com/piwik/');
360
    variable_get('piwik_url_https', 'https://example.com/piwik/');
361

    
362
    // Test if the default settings are working as expected.
363

    
364
    // Add to the selected roles only.
365
    variable_set('piwik_visibility_roles', 0);
366
    // Enable tracking for all users.
367
    variable_set('piwik_roles', array());
368

    
369
    // Check tracking code visibility.
370
    $this->drupalGet('');
371
    $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for anonymous users on frontpage with default settings.');
372
    $this->drupalGet('admin');
373
    $this->assertRaw('"403/URL = "', '[testPiwikRoleVisibility]: 403 Forbidden tracking code is displayed for anonymous users in admin section with default settings.');
374

    
375
    $this->drupalLogin($this->admin_user);
376

    
377
    $this->drupalGet('');
378
    $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for authenticated users on frontpage with default settings.');
379
    $this->drupalGet('admin');
380
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed for authenticated users in admin section with default settings.');
381

    
382
    // Test if the non-default settings are working as expected.
383

    
384
    // Enable tracking only for authenticated users.
385
    variable_set('piwik_roles', array(DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID));
386

    
387
    $this->drupalGet('');
388
    $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for authenticated users only on frontpage.');
389

    
390
    $this->drupalLogout();
391
    $this->drupalGet('');
392
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed for anonymous users on frontpage.');
393

    
394
    // Add to every role except the selected ones.
395
    variable_set('piwik_visibility_roles', 1);
396
    // Enable tracking for all users.
397
    variable_set('piwik_roles', array());
398

    
399
    // Check tracking code visibility.
400
    $this->drupalGet('');
401
    $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and displayed for anonymous users.');
402
    $this->drupalGet('admin');
403
    $this->assertRaw('"403/URL = "', '[testPiwikRoleVisibility]: 403 Forbidden tracking code is shown for anonymous users if every role except the selected ones is selected.');
404

    
405
    $this->drupalLogin($this->admin_user);
406

    
407
    $this->drupalGet('');
408
    $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and displayed on frontpage for authenticated users.');
409
    $this->drupalGet('admin');
410
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and NOT displayed in admin section for authenticated users.');
411

    
412
    // Disable tracking for authenticated users.
413
    variable_set('piwik_roles', array(DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID));
414

    
415
    $this->drupalGet('');
416
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed on frontpage for excluded authenticated users.');
417
    $this->drupalGet('admin');
418
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed in admin section for excluded authenticated users.');
419

    
420
    $this->drupalLogout();
421
    $this->drupalGet('');
422
    $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed on frontpage for included anonymous users.');
423
  }
424

    
425
}
426

    
427
class PiwikPhpFilterTest extends DrupalWebTestCase {
428

    
429
  public static function getInfo() {
430
    return array(
431
      'name' => 'Piwik php filter tests',
432
      'description' => 'Test php filter functionality of Piwik module.',
433
      'group' => 'Piwik',
434
    );
435
  }
436

    
437
  function setUp() {
438
    parent::setUp('piwik', 'php');
439

    
440
    // Administrator with all permissions.
441
    $permissions_admin_user = array(
442
      'access administration pages',
443
      'administer piwik',
444
      'use PHP for tracking visibility',
445
    );
446
    $this->admin_user = $this->drupalCreateUser($permissions_admin_user);
447

    
448
    // Administrator who cannot configure tracking visibility with PHP.
449
    $permissions_delegated_admin_user = array(
450
      'access administration pages',
451
      'administer piwik',
452
    );
453
    $this->delegated_admin_user = $this->drupalCreateUser($permissions_delegated_admin_user);
454
  }
455

    
456
  function testPiwikPhpFilter() {
457
    $ua_code = '1';
458
    $this->drupalLogin($this->admin_user);
459

    
460
    $edit = array();
461
    $edit['piwik_site_id'] = $ua_code;
462
    $edit['piwik_url_http'] = 'http://example.com/piwik/';
463
    $edit['piwik_url_https'] = 'https://example.com/piwik/';
464
    $edit['piwik_url_skiperror'] = TRUE; // Required for testing only.
465
    $edit['piwik_visibility_pages'] = 2;
466
    $edit['piwik_pages'] = '<?php return 0; ?>';
467
    $this->drupalPost('admin/config/system/piwik', $edit, t('Save configuration'));
468

    
469
    // Compare saved setting with posted setting.
470
    $piwik_pages = variable_get('piwik_pages', $this->randomName(8));
471
    $this->assertEqual('<?php return 0; ?>', $piwik_pages, '[testPiwikPhpFilter]: PHP code snippet is intact.');
472

    
473
    // Check tracking code visibility.
474
    variable_set('piwik_pages', '<?php return TRUE; ?>');
475
    $this->drupalGet('');
476
    $this->assertRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is displayed on frontpage page.');
477
    $this->drupalGet('admin');
478
    $this->assertRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is displayed on admin page.');
479

    
480
    variable_set('piwik_pages', '<?php return FALSE; ?>');
481
    $this->drupalGet('');
482
    $this->assertNoRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is not displayed on frontpage page.');
483

    
484
    // Test administration form.
485
    variable_set('piwik_pages', '<?php return TRUE; ?>');
486
    $this->drupalGet('admin/config/system/piwik');
487
    $this->assertRaw(t('Pages on which this PHP code returns <code>TRUE</code> (experts only)'), '[testPiwikPhpFilter]: Permission to administer PHP for tracking visibility.');
488
    $this->assertRaw(check_plain('<?php return TRUE; ?>'), '[testPiwikPhpFilter]: PHP code snippted is displayed.');
489

    
490
    // Login the delegated user and check if fields are visible.
491
    $this->drupalLogin($this->delegated_admin_user);
492
    $this->drupalGet('admin/config/system/piwik');
493
    $this->assertNoRaw(t('Pages on which this PHP code returns <code>TRUE</code> (experts only)'), '[testPiwikPhpFilter]: No permission to administer PHP for tracking visibility.');
494
    $this->assertNoRaw(check_plain('<?php return TRUE; ?>'), '[testPiwikPhpFilter]: No permission to view PHP code snippted.');
495

    
496
    // Set a different value and verify that this is still the same after the post.
497
    variable_set('piwik_pages', '<?php return 0; ?>');
498

    
499
    $edit = array();
500
    $edit['piwik_site_id'] = $ua_code;
501
    $edit['piwik_url_http'] = 'http://example.com/piwik/';
502
    $edit['piwik_url_https'] = 'https://example.com/piwik/';
503
    $edit['piwik_url_skiperror'] = TRUE; // Required for testing only.
504
    $this->drupalPost('admin/config/system/piwik', $edit, t('Save configuration'));
505

    
506
    // Compare saved setting with posted setting.
507
    $piwik_visibility_pages = variable_get('piwik_visibility_pages', 0);
508
    $piwik_pages = variable_get('piwik_pages', $this->randomName(8));
509
    $this->assertEqual(2, $piwik_visibility_pages, '[testPiwikPhpFilter]: Pages on which this PHP code returns TRUE is selected.');
510
    $this->assertEqual('<?php return 0; ?>', $piwik_pages, '[testPiwikPhpFilter]: PHP code snippet is intact.');
511
  }
512

    
513
}