Chris@0: drupalCreateUser(['create page content', 'administer content types', 'access user profiles']); Chris@0: $this->drupalLogin($web_user); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Confirms "Basic page" content type and post information is on a new node. Chris@0: */ Chris@0: public function testPagePostInfo() { Chris@0: Chris@0: // Set "Basic page" content type to display post information. Chris@0: $edit = []; Chris@0: $edit['display_submitted'] = TRUE; Chris@0: $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type')); Chris@0: Chris@0: // Create a node. Chris@0: $edit = []; Chris@0: $edit['title[0][value]'] = $this->randomMachineName(8); Chris@0: $edit['body[0][value]'] = $this->randomMachineName(16); Chris@0: $this->drupalPostForm('node/add/page', $edit, t('Save')); Chris@0: Chris@0: // Check that the post information is displayed. Chris@0: $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); Chris@0: $elements = $this->xpath('//div[contains(@class, :class)]', [':class' => 'node__submitted']); Chris@0: $this->assertEqual(count($elements), 1, 'Post information is displayed.'); Chris@0: $node->delete(); Chris@0: Chris@0: // Set "Basic page" content type to display post information. Chris@0: $edit = []; Chris@0: $edit['display_submitted'] = FALSE; Chris@0: $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type')); Chris@0: Chris@0: // Create a node. Chris@0: $edit = []; Chris@0: $edit['title[0][value]'] = $this->randomMachineName(8); Chris@0: $edit['body[0][value]'] = $this->randomMachineName(16); Chris@0: $this->drupalPostForm('node/add/page', $edit, t('Save')); Chris@0: Chris@0: // Check that the post information is displayed. Chris@0: $elements = $this->xpath('//div[contains(@class, :class)]', [':class' => 'node__submitted']); Chris@0: $this->assertEqual(count($elements), 0, 'Post information is not displayed.'); Chris@0: } Chris@0: Chris@0: }