function CasRequiredLoginTestCase::testCasExclude in CAS 6.3
Same name and namespace in other branches
- 7 cas.test \CasRequiredLoginTestCase::testCasExclude()
Test redirection prevented by cas_exclude.
File
- ./
cas.test, line 783 - Tests for cas.module.
Class
- CasRequiredLoginTestCase
- Test case for CAS force login feature.
Code
function testCasExclude() {
$node = $this
->drupalCreateNode();
$account = $this
->casCreateUser();
$this
->setCasUser($account);
variable_set('cas_check_first', TRUE);
variable_set('cas_exclude', "node/{$node->nid}");
// Visit an excluded page and ensure we did not try to log in.
$this
->drupalGet("node/{$node->nid}");
$this
->assertField('name', t('Username field found.'), t('Logout'));
$this
->assertField('pass', t('Password field found.'), t('Logout'));
// Visit another page and ensure we logged in.
$this
->drupalGet('node');
$this
->assertLoggedIn($account);
$this
->assertUrl('node');
}