Issue #1970588 by Heine: SearchExcerptTestCase should be a DrupalWebTestCase.

merge-requests/26/head
David Rothstein 2013-12-27 15:22:28 -05:00
parent 66a58e4611
commit c0049262b3
1 changed files with 3 additions and 4 deletions

View File

@ -1567,7 +1567,7 @@ class SearchConfigSettingsForm extends DrupalWebTestCase {
/** /**
* Tests the search_excerpt() function. * Tests the search_excerpt() function.
*/ */
class SearchExcerptTestCase extends DrupalUnitTestCase { class SearchExcerptTestCase extends DrupalWebTestCase {
public static function getInfo() { public static function getInfo() {
return array( return array(
'name' => 'Search excerpt extraction', 'name' => 'Search excerpt extraction',
@ -1577,8 +1577,7 @@ class SearchExcerptTestCase extends DrupalUnitTestCase {
} }
function setUp() { function setUp() {
drupal_load('module', 'search'); parent::setUp('search');
parent::setUp();
} }
/** /**
@ -1603,7 +1602,7 @@ class SearchExcerptTestCase extends DrupalUnitTestCase {
$this->assertEqual($result, 'The quick brown <strong>fox</strong> &amp; jumps over the lazy dog ...', 'Found keyword is highlighted'); $this->assertEqual($result, 'The quick brown <strong>fox</strong> &amp; jumps over the lazy dog ...', 'Found keyword is highlighted');
$longtext = str_repeat($text . ' ', 10); $longtext = str_repeat($text . ' ', 10);
$result = preg_replace('| +|', ' ', search_excerpt('nothing', $text)); $result = preg_replace('| +|', ' ', search_excerpt('nothing', $longtext));
$this->assertTrue(strpos($result, $expected) === 0, 'When keyword is not found in long string, return value starts as expected'); $this->assertTrue(strpos($result, $expected) === 0, 'When keyword is not found in long string, return value starts as expected');
$entities = str_repeat('k&eacute;sz&iacute;t&eacute;se ', 20); $entities = str_repeat('k&eacute;sz&iacute;t&eacute;se ', 20);