diff --git a/core/modules/filter/filter.test b/core/modules/filter/filter.test index 2bafd47..8913dec 100644 --- a/core/modules/filter/filter.test +++ b/core/modules/filter/filter.test @@ -1101,6 +1101,10 @@ class FilterUnitTestCase extends DrupalUnitTestCase { $f = _filter_html(' ', $filter); $this->assertNoNormalized($f, 'onerror', t('HTML filter should remove empty on* attributes on default.')); + + // The HTML filter should allow the tag. + $f = _filter_html('teaser body', $filter); + $this->assertIdentical($f, 'teaser body', 'HTML filter should not remove the <!--break--> tag.'); } /** diff --git a/core/modules/node/node.test b/core/modules/node/node.test index f828164..068b4cd 100644 --- a/core/modules/node/node.test +++ b/core/modules/node/node.test @@ -624,6 +624,45 @@ class SummaryLengthTestCase extends DrupalWebTestCase { } } +/** + * Tests the node summary break separator. + */ +class SummaryBreakTestCase extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => 'Summary break', + 'description' => 'Test the summary break separator.', + 'group' => 'Node', + ); + } + + /** + * Tests that the separator properly delimits the summary. + */ + function testSummaryBreak() { + // Create a node to view. + $settings = array( + 'body' => array(LANGUAGE_NONE => array(array('value' => 'Lorem ipsum dolor sit ametconsectetur adipiscing elit.'))), + 'promote' => 1, + ); + $node = $this->drupalCreateNode($settings); + + // Create user with permission to view the node. + $web_user = $this->drupalCreateUser(array('access content')); + $this->drupalLogin($web_user); + + // Check for the node's teaser on the promoted node listing. + $this->drupalGet('node'); + $this->assertRaw('Lorem ipsum dolor sit amet', 'The node summary is found.'); + $this->assertNoRaw('consectetur adipiscing elit.', 'Text after the break separator is not found.'); + + // Check the text on the full node page. + $this->drupalGet('node/' . $node->nid); + $this->assertRaw('Lorem ipsum dolor sit amet', 'The node summary is found.'); + $this->assertRaw('consectetur adipiscing elit.', 'Text after the break separator is found.'); + } +} + class NodeTitleXSSTestCase extends DrupalWebTestCase { public static function getInfo() { return array(