You are here

function CasLoginBlockTestCase::setUp in CAS 7

Same name and namespace in other branches
  1. 6.3 cas.test \CasLoginBlockTestCase::setUp()

Helper class for CAS tests.

Creates an administrative user and downloads phpCAS.

Overrides CasTestHelper::setUp

File

./cas.test, line 821
Tests for cas.module.

Class

CasLoginBlockTestCase
Tests the visibility and functionality of the CAS login block.

Code

function setUp() {
  parent::setUp();

  // Enable the CAS login block.
  $admin_user = $this
    ->drupalCreateUser(array(
    'administer blocks',
  ));
  $this
    ->drupalLogin($admin_user);
  $edit = array(
    'blocks[user_login][region]' => '-1',
    'blocks[cas_login][region]' => 'sidebar_first',
  );
  $this
    ->drupalPost('admin/structure/block', $edit, t('Save blocks'));
  $this
    ->drupalLogout();
}