Issue #1970588 by Heine: SearchExcerptTestCase should be a DrupalWebTestCase.
parent
66a58e4611
commit
c0049262b3
|
@ -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> & jumps over the lazy dog ...', 'Found keyword is highlighted');
|
$this->assertEqual($result, 'The quick brown <strong>fox</strong> & 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észítése ', 20);
|
$entities = str_repeat('készítése ', 20);
|
||||||
|
|
Loading…
Reference in New Issue