You are here

m4032404.test in 403 to 404 7

Tests for m4032404.

File

tests/m4032404.test
View source
<?php

/**
 * @file
 * Tests for m4032404.
 */

/**
 * Tests the functionality of the m4032404 module.
 */
class M4032404TestCase extends DrupalWebTestCase {
  protected $privilegedUser;

  /**
   * Tell Drupal and Simpletest about these tests.
   */
  public static function getInfo() {

    // Note: getInfo() strings are not translated with t().
    return array(
      'name' => 'm4032404',
      'description' => 'Ensures m4032404 works as intended.',
      'group' => 'm4032404',
    );
  }

  /**
   * Setup the default environment settings.
   */
  public function setUp() {

    // Enable m4032404.
    parent::setUp(array(
      'm4032404',
    ));

    // Create and log in our privileged user.
    $this->privilegedUser = $this
      ->drupalCreateUser(array(
      'access content',
    ));
    $this
      ->drupalLogin($this->privilegedUser);

    // Set site_403 variable to test.
    variable_set('site_403', 'm4032404');
  }

  /**
   * Tests 404 Not Found response when hitting /admin.
   */
  public function testM4032404Test404() {
    $this
      ->drupalGet('admin');
    $this
      ->assertResponse(404, 'Anonymous users get a 404 instead of a 403.');
  }

}

Classes

Namesort descending Description
M4032404TestCase Tests the functionality of the m4032404 module.