| 7 search.test | SearchNumbersTestCase::testNumberSearching() |
| 8 search.test | SearchNumbersTestCase::testNumberSearching() |
Tests that all the numbers can be searched.
File
- modules/
search/ search.test, line 1297 - Tests for search.module.
Code
function testNumberSearching() {
$types = array_keys($this->numbers);
foreach ($types as $type) {
$number = $this->numbers[$type];
// If the number is negative, remove the - sign, because - indicates
// "not keyword" when searching.
$number = ltrim($number, '-');
$node = $this->nodes[$type];
// Verify that the node title does not appear on the search page
// with a dummy search.
$this->drupalPost('search/node',
array('keys' => 'foo'),
t('Search'));
$this->assertNoText($node->title, $type . ': node title not shown in dummy search');
// Verify that the node title does appear as a link on the search page
// when searching for the number.
$this->drupalPost('search/node',
array('keys' => $number),
t('Search'));
$this->assertText($node->title, $type . ': node title shown (search found the node) in search for number ' . $number);
}
}
Login or register to post comments