public function TokenBlockTestCase::testBlockTitleTokens in Token 7        
                          
                  
                        
File
 
   - ./token.test, line 1078
 
  - Test integration for the token module.
 
  Class
  
  - TokenBlockTestCase 
 
  
Code
public function testBlockTitleTokens() {
  $edit['title'] = '[user:name]';
  $edit['info'] = 'Test token title block';
  $edit['body[value]'] = 'This is the test token title block.';
  $this
    ->drupalPost('admin/structure/block/add', $edit, 'Save block');
  
  $this
    ->assertText('Block title is using the following invalid tokens: [user:name].');
  
  $edit['title'] = '[current-page:title] block title';
  $edit['regions[bartik]'] = 'sidebar_first';
  $this
    ->drupalPost(NULL, $edit, 'Save block');
  $this
    ->drupalGet('node');
  $this
    ->assertText('Welcome to ' . variable_get('site_name', 'Drupal') . ' block title');
  
  $node = $this
    ->drupalCreateNode(array(
    'title' => "Site's first node",
  ));
  $this
    ->drupalGet('node/' . $node->nid);
  
  $this
    ->assertRaw("Site's first node block title");
}