Révision 6ff32cea
Ajouté par Florent Torregrosa il y a environ 9 ans
drupal7/modules/search/search.test | ||
---|---|---|
2048 | 2048 |
} |
2049 | 2049 |
} |
2050 | 2050 |
|
2051 |
/** |
|
2052 |
* Tests node search with query tags. |
|
2053 |
*/ |
|
2054 |
class SearchNodeTagTest extends DrupalWebTestCase { |
|
2055 |
public $test_user; |
|
2056 |
|
|
2057 |
public static function getInfo() { |
|
2058 |
return array( |
|
2059 |
'name' => 'Node search query tags', |
|
2060 |
'description' => 'Tests Node search tags functionality.', |
|
2061 |
'group' => 'Search', |
|
2062 |
); |
|
2063 |
} |
|
2064 |
|
|
2065 |
function setUp() { |
|
2066 |
parent::setUp('search', 'search_node_tags'); |
|
2067 |
node_access_rebuild(); |
|
2068 |
|
|
2069 |
// Create a test user and log in. |
|
2070 |
$this->test_user = $this->drupalCreateUser(array('search content')); |
|
2071 |
$this->drupalLogin($this->test_user); |
|
2072 |
} |
|
2073 |
|
|
2074 |
/** |
|
2075 |
* Tests that the correct tags are available and hooks invoked. |
|
2076 |
*/ |
|
2077 |
function testNodeSearchQueryTags() { |
|
2078 |
$this->drupalCreateNode(array('body' => array(LANGUAGE_NONE => array(array('value' => 'testing testing testing.'))))); |
|
2079 |
|
|
2080 |
// Update the search index. |
|
2081 |
module_invoke_all('update_index'); |
|
2082 |
search_update_totals(); |
|
2083 |
|
|
2084 |
$edit = array('keys' => 'testing'); |
|
2085 |
$this->drupalPost('search/node', $edit, t('Search')); |
|
2086 |
|
|
2087 |
$this->assertTrue(variable_get('search_node_tags_test_query_tag', FALSE), 'hook_query_alter() was invoked and the query contained the "search_node" tag.'); |
|
2088 |
$this->assertTrue(variable_get('search_node_tags_test_query_tag_hook', FALSE), 'hook_query_search_node_alter() was invoked.'); |
|
2089 |
} |
|
2090 |
} |
|
2091 |
|
|
2051 | 2092 |
/** |
2052 | 2093 |
* Tests searching with locale values set. |
2053 | 2094 |
*/ |
Formats disponibles : Unified diff
Update core to 7.36