File
- modules/profile/profile.test, line 401
- Tests for profile.module.
Code
function testAuthorInformationBlock() {
$edit = array();
$edit['blocks[profile_author-information][region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
$this->drupalPost('admin/structure/block/manage/profile/author-information/configure', array(
'profile_block_author_fields[' . $this->field1['form_name'] . ']' => TRUE,
), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
$this->drupalGet('node/' . $this->node->nid);
$this->assertRaw($this->value1, t('Field 1 is displayed'));
$this->assertNoRaw($this->value2, t('Field 2 is not displayed'));
$this->drupalPost('admin/structure/block/manage/profile/author-information/configure', array(
'profile_block_author_fields[' . $this->field1['form_name'] . ']' => FALSE,
'profile_block_author_fields[' . $this->field2['form_name'] . ']' => TRUE,
), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
$this->drupalGet('node/' . $this->node->nid);
$this->assertNoRaw($this->value1, t('Field 1 is not displayed'));
$this->assertRaw($this->value2, t('Field 2 is displayed'));
$this->drupalPost('admin/structure/block/manage/profile/author-information/configure', array(
'profile_block_author_fields[' . $this->field1['form_name'] . ']' => TRUE,
'profile_block_author_fields[' . $this->field2['form_name'] . ']' => TRUE,
), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
$this->drupalGet('node/' . $this->node->nid);
$this->assertRaw($this->value1, t('Field 1 is displayed'));
$this->assertRaw($this->value2, t('Field 2 is displayed'));
$this->drupalPost('admin/structure/block/manage/profile/author-information/configure', array(
'profile_block_author_fields[user_profile]' => TRUE,
), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
$this->drupalGet('node/' . $this->node->nid);
$this->clickLink(t('View full user profile'));
$this->assertEqual($this->getUrl(), url('user/' . $this->normal_user->uid, array('absolute' => TRUE)));
}
Login or
register to post comments