Projet

Général

Profil

Révision bc175c27

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/honeypot/honeypot.test
387 387
    // Make sure the Honeypot CSS file exists.
388 388
    $this->assertTrue(file_exists($honeypot_css));
389 389
  }
390

  
391
  /**
392
   * Test CSS file availability.
393
   */
394
  public function testHoneypotCssAvailability() {
395
    // Public CSS file can be consumed.
396
    variable_set('file_default_scheme', 'public');
397
    if ($wrapper = file_stream_wrapper_get_instance_by_uri(honeypot_get_css_file_path())) {
398
      $url = $wrapper->getExternalUrl();
399
    }
400
    $this->drupalGet($url);
401
    $this->assertResponse(200);
402

  
403

  
404
    // Private CSS file can not be consumed.
405
    variable_set('file_default_scheme', 'private');
406
    honeypot_cron();
407
    if ($wrapper = file_stream_wrapper_get_instance_by_uri(honeypot_get_css_file_path())) {
408
      $url = $wrapper->getExternalUrl();
409
    }
410
    $this->drupalGet($url);
411
    $this->assertNoResponse(200);
412

  
413
    // Site default is private, but override honeypot's to public to consume.
414
    variable_set('honeypot_file_default_scheme', 'public');
415
    honeypot_cron();
416
    if ($wrapper = file_stream_wrapper_get_instance_by_uri(honeypot_get_css_file_path())) {
417
      $url = $wrapper->getExternalUrl();
418
    }
419
    $this->drupalGet($url);
420
    $this->assertResponse(200);
421
  }
422

  
390 423
}
391 424

  
392 425
/**
......
444 477
    $this->drupalGet('node');
445 478
    $this->assertText(t('has been banned'), 'User banned successfully.');
446 479
  }
480

  
447 481
}

Formats disponibles : Unified diff