Projet

Général

Profil

Révision 147616a8

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/piwik/piwik.test
109 109

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

  
114 114
    // Test whether 404 not found tracking code is shown on non-existent pages.
115 115
    $this->drupalGet($this->randomName(64));
116
    $this->assertRaw('"404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
116
    $this->assertRaw('404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
117 117
  }
118 118

  
119 119
  function testPiwikTrackingCode() {
......
310 310
  }
311 311
}
312 312

  
313
/**
314
 * Test custom url functionality of Google Analytics module.
315
 */
316
class PiwikCustomUrls extends DrupalWebTestCase {
317

  
318
  public static function getInfo() {
319
    return array(
320
      'name' => 'Piwik custom url tests',
321
      'description' => 'Test custom url functionality of Piwik module.',
322
      'group' => 'Piwik',
323
    );
324
  }
325

  
326
  function setUp() {
327
    parent::setUp('piwik');
328

  
329
    $permissions = array(
330
      'access administration pages',
331
      'administer piwik',
332
    );
333

  
334
    // User to set up piwik.
335
    $this->admin_user = $this->drupalCreateUser($permissions);
336
  }
337

  
338
  /**
339
   * Tests if user password page urls are overridden.
340
   */
341
  public function testPiwikUserPasswordPage() {
342
    $base_path = base_path();
343
    $ua_code = '1';
344
    variable_set('piwik_site_id', $ua_code);
345
    variable_get('piwik_url_http', 'http://example.com/piwik/');
346
    variable_get('piwik_url_https', 'https://example.com/piwik/');
347

  
348
    $this->drupalGet('user/password', array('query' => array('name' => 'foo')));
349
    $this->assertRaw('_paq.push(["setCustomUrl", ' . drupal_json_encode(url('user/password')) . ']);');
350

  
351
    $this->drupalGet('user/password', array('query' => array('name' => 'foo@example.com')));
352
    $this->assertRaw('_paq.push(["setCustomUrl", ' . drupal_json_encode(url('user/password')) . ']);');
353

  
354
    $this->drupalGet('user/password');
355
    $this->assertNoRaw('_paq.push(["setCustomUrl", "', '[testPiwikCustomUrls]: Custom url not set.');
356
  }
357

  
358
}
359

  
313 360
class PiwikStatusMessagesTest extends DrupalWebTestCase {
314 361

  
315 362
  public static function getInfo() {

Formats disponibles : Unified diff