You are here

class NodeExpireAdminTestCase in Node expire 8

Same name in this branch
  1. 8 tests/node_expire.admin.test \NodeExpireAdminTestCase
  2. 8 src/Tests/NodeExpireAdminTestCase.php \Drupal\node_expire\Tests\NodeExpireAdminTestCase
Same name and namespace in other branches
  1. 7.2 tests/node_expire.admin.test \NodeExpireAdminTestCase
  2. 7 tests/node_expire.admin.test \NodeExpireAdminTestCase

Test for Node Expire admin UI.

Hierarchy

Expanded class hierarchy of NodeExpireAdminTestCase

File

tests/node_expire.admin.test, line 11
Contains NodeExpireAdminTestCase.

View source
class NodeExpireAdminTestCase extends DrupalWebTestCase {

  /**
   * Implements getInfo().
   */
  public static function getInfo() {
    return array(
      'name' => 'Node Expire UI',
      'description' => 'Tests for the administrative UI.',
      'group' => 'Node Expire',
    );
  }

  /**
   * Overrides setUp().
   */
  public function setUp() {
    parent::setUp(array(
      'rules',
      'node_expire',
    ));

    // Create test user.
    $this->admin_user = $this
      ->drupalCreateUser(array(
      'access content',
      'administer content types',
      'administer site configuration',
      'administer modules',
    ));
    $this
      ->drupalLogin($this->admin_user);

    // Create content type, with underscores.
    $type_name = strtolower($this
      ->randomName(8)) . '_test';
    $type = $this
      ->drupalCreateContentType(array(
      'name' => $type_name,
      'type' => $type_name,
    ));
    $this->type = $type->type;

    // Store a valid URL name, with hyphens instead of underscores.
    $this->hyphen_type = str_replace('_', '-', $this->type);
  }

  /**
   * Makes test.
   */
  public function testFieldAdminHandler() {
    $test_path = 'admin/config/workflow/node_expire/settings';
    $this
      ->drupalGet($test_path);
    $this
      ->assertText(t('Allow expire date in the past'), 'The text "Allow expire date in the past" appears on the Node expire settings page.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NodeExpireAdminTestCase::getInfo public static function Implements getInfo().
NodeExpireAdminTestCase::setUp public function Overrides setUp().
NodeExpireAdminTestCase::testFieldAdminHandler public function Makes test.