diff --git a/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php b/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php index 9936454..95e64f0 100644 --- a/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/SummaryLengthTest.php @@ -35,24 +35,26 @@ function testSummaryLength() { $web_user = $this->drupalCreateUser(array('access content', 'administer content types')); $this->loggedInUser = $web_user; - // Render the node as teaser. + // Render the node as a teaser. $content = entity_render_controller('node')->view($node, 'teaser'); $this->drupalSetContent(drupal_render($content)); - // The node teaser when it has 600 characters in length + // The string 'What is a Drupalism?' is between the 200th and 600th + // characters of the node body, so it should be included if the summary is + // 600 characters long. $expected = 'What is a Drupalism?'; - $this->assertRaw($expected, 'Check that the summary is 600 characters in length', 'Node'); + $this->assertRaw($expected); // Change the teaser length for "Basic page" content type. $instance = field_info_instance('node', 'body', $node->type); $instance['display']['teaser']['settings']['trim_length'] = 200; field_update_instance($instance); - // Render the node as teaser again and check if the summary is now only 200 - // characters in length. + // Render the node as a teaser again and check that the summary is now only + // 200 characters in length and so does not include 'What is a Drupalism?'. $content = entity_render_controller('node')->view($node, 'teaser'); $this->drupalSetContent(drupal_render($content)); $this->assertText($node->label()); - $this->assertNoRaw($expected, 'Check that the summary is not longer than 200 characters', 'Node'); + $this->assertNoRaw($expected); } }