function PrivatemsgLinksTestCase::testNewBlock in Privatemsg 6.2
Same name and namespace in other branches
- 6 privatemsg.test \PrivatemsgLinksTestCase::testNewBlock()
- 7.2 privatemsg.test \PrivatemsgLinksTestCase::testNewBlock()
- 7 privatemsg.test \PrivatemsgLinksTestCase::testNewBlock()
Tests menu block.
File
- ./
privatemsg.test, line 897 - Test file for privatemsg.module
Class
- PrivatemsgLinksTestCase
- Tests for node, blocks and profile integration.
Code
function testNewBlock() {
$admin = $this
->drupalCreateUser(array(
'read privatemsg',
'write privatemsg',
'administer privatemsg settings',
'administer blocks',
'administer menu',
));
$user = $this
->drupalCreateUser(array(
'read privatemsg',
));
// Enable block.
$this
->drupalLogin($admin);
$blocks = array(
'privatemsg_privatemsg-new[region]' => 'right',
);
$this
->drupalPost('admin/build/block', $blocks, t('Save blocks'));
$this
->drupalGet('');
$this
->assertNoRaw('<h2>New message</h2>', t('Privatemsg new block title not displayed.'));
$message = array(
'recipient' => $user->name,
'subject' => $this
->randomName(),
'body' => $this
->randomName(50),
);
$this
->drupalPost('messages/new', $message, t('Send message'));
$this
->drupalLogin($user);
$this
->assertRaw('<h2>New message</h2>', t('Privatemsg new block title displayed.'));
$this
->assertText(t('You have a new message! Click here to read it.'), t('New message indication displayed.'));
}