Révision c9e51f47
Ajouté par Julien Enselme il y a environ 7 ans
drupal7/modules/search/search.test | ||
---|---|---|
1453 | 1453 |
parent::setUp('search', 'search_extra_type'); |
1454 | 1454 |
|
1455 | 1455 |
// Login as a user that can create and search content. |
1456 |
$this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks')); |
|
1456 |
$this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports'));
|
|
1457 | 1457 |
$this->drupalLogin($this->search_user); |
1458 | 1458 |
|
1459 | 1459 |
// Add a single piece of content and index it. |
... | ... | |
1502 | 1502 |
); |
1503 | 1503 |
$this->drupalPost('admin/config/search/settings', $edit, t('Save configuration')); |
1504 | 1504 |
$this->assertNoText(t('The configuration options have been saved.'), 'Form does not save with an invalid word length.'); |
1505 |
|
|
1506 |
// Test logging setting. It should be on by default. |
|
1507 |
$text = $this->randomName(5); |
|
1508 |
$this->drupalPost('search/node', array('keys' => $text), t('Search')); |
|
1509 |
$this->drupalGet('admin/reports/dblog'); |
|
1510 |
$this->assertLink('Searched Content for ' . $text . '.', 0, 'Search was logged'); |
|
1511 |
|
|
1512 |
// Turn off logging. |
|
1513 |
variable_set('search_logging', FALSE); |
|
1514 |
$text = $this->randomName(5); |
|
1515 |
$this->drupalPost('search/node', array('keys' => $text), t('Search')); |
|
1516 |
$this->drupalGet('admin/reports/dblog'); |
|
1517 |
$this->assertNoLink('Searched Content for ' . $text . '.', 'Search was not logged'); |
|
1505 | 1518 |
} |
1506 | 1519 |
|
1507 | 1520 |
/** |
Formats disponibles : Unified diff
Udpate to 7.54