You are here

public function AdminViewsDefaultViewsTestCase::testComment in Administration Views 7

Tests basic appearance and behavior of built-in default views.

File

tests/admin_views.test, line 183
Tests for the Administration Views module.

Class

AdminViewsDefaultViewsTestCase
Tests default views.

Code

public function testComment() {
  $this
    ->drupalLogin($this->admin_user);
  foreach (array(
    'admin/content/comment',
    'admin/content/comment/approval',
  ) as $path) {
    $this
      ->drupalGet($path);
    $this
      ->assertOriginalRouterItem('comment', $path);

    // Verify that a view with its exposed filters appears.
    $this
      ->assertFieldByName('subject');
    $this
      ->assertFieldByName('author');
    $this
      ->assertFieldByName('nodeTitle');
    $this
      ->assertFieldByName('status');
    $this
      ->assertFieldByXPath('//select[@name="status"]/option', 'All', 'Published: All option found.');
    $this
      ->assertFieldByXPath('//select[@name="status"]/option', '1', 'Published: Yes option found.');
    $this
      ->assertFieldByXPath('//select[@name="status"]/option', '0', 'Published: No option found.');
    $this
      ->assertFieldByXPath('//input[@type="submit"]', t('Apply'), 'Apply button found.');
    $this
      ->assertFieldByXPath('//input[@type="submit"]', t('Reset'), 'Reset button found.');
  }
}