comparison core/modules/node/tests/src/Functional/NodeTitleTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
32 * {@inheritdoc} 32 * {@inheritdoc}
33 */ 33 */
34 protected function setUp() { 34 protected function setUp() {
35 parent::setUp(); 35 parent::setUp();
36 $this->drupalPlaceBlock('system_breadcrumb_block'); 36 $this->drupalPlaceBlock('system_breadcrumb_block');
37 $this->drupalPlaceBlock('page_title_block');
37 38
38 $this->adminUser = $this->drupalCreateUser(['administer nodes', 'create article content', 'create page content', 'post comments']); 39 $this->adminUser = $this->drupalCreateUser(['administer nodes', 'create article content', 'create page content', 'post comments']);
39 $this->drupalLogin($this->adminUser); 40 $this->drupalLogin($this->adminUser);
40 $this->addDefaultCommentField('node', 'page'); 41 $this->addDefaultCommentField('node', 'page');
41 } 42 }
78 // Test that 0 appears as <title>. 79 // Test that 0 appears as <title>.
79 $this->drupalGet('node/' . $node->id()); 80 $this->drupalGet('node/' . $node->id());
80 $this->assertTitle(0 . ' | Drupal', 'Page title is equal to 0.', 'Node'); 81 $this->assertTitle(0 . ' | Drupal', 'Page title is equal to 0.', 'Node');
81 // Test that 0 appears in the template <h1>. 82 // Test that 0 appears in the template <h1>.
82 $xpath = '//h1'; 83 $xpath = '//h1';
83 $this->assertEqual(current($this->xpath($xpath)), 0, 'Node title is displayed as 0.', 'Node'); 84 $this->assertSame('0', $this->xpath($xpath)[0]->getText(), 'Node title is displayed as 0.');
84 85
85 // Test edge case where node title contains special characters. 86 // Test edge case where node title contains special characters.
86 $edge_case_title = 'article\'s "title".'; 87 $edge_case_title = 'article\'s "title".';
87 $settings = [ 88 $settings = [
88 'title' => $edge_case_title, 89 'title' => $edge_case_title,