class SearchExcerptTest in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/search/src/Tests/SearchExcerptTest.php \Drupal\search\Tests\SearchExcerptTest
Tests the search_excerpt() function.
@group search
Hierarchy
- class \Drupal\simpletest\TestBase uses AssertHelperTrait, RandomGeneratorTrait, SessionTestTrait
- class \Drupal\simpletest\KernelTestBase uses AssertContentTrait
- class \Drupal\search\Tests\SearchExcerptTest
- class \Drupal\simpletest\KernelTestBase uses AssertContentTrait
Expanded class hierarchy of SearchExcerptTest
File
- core/
modules/ search/ src/ Tests/ SearchExcerptTest.php, line 17 - Contains \Drupal\search\Tests\SearchExcerptTest.
Namespace
Drupal\search\TestsView source
class SearchExcerptTest extends KernelTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array(
'search',
'search_langcode_test',
);
/**
* Tests search_excerpt() with several simulated search keywords.
*
* Passes keywords and a sample marked up string, "The quick
* brown fox jumps over the lazy dog", and compares it to the
* correctly marked up string. The correctly marked up string
* contains either highlighted keywords or the original marked
* up string if no keywords matched the string.
*/
function testSearchExcerpt() {
// Make some text with entities and tags.
$text = 'The <strong>quick</strong> <a href="#">brown</a> fox & jumps <h2>over</h2> the lazy dog';
$expected = 'The quick brown fox & jumps over the lazy dog';
$result = $this
->doSearchExcerpt('nothing', $text);
$this
->assertEqual(preg_replace('| +|', ' ', $result), $expected, 'Entire string, stripped of HTML tags, is returned when keyword is not found in short string');
$result = $this
->doSearchExcerpt('fox', $text);
$this
->assertEqual($result, 'The quick brown <strong>fox</strong> & jumps over the lazy dog', 'Found keyword is highlighted');
$expected = '<strong>The</strong> quick brown fox & jumps over <strong>the</strong> lazy dog';
$result = $this
->doSearchExcerpt('The', $text);
$this
->assertEqual(preg_replace('| +|', ' ', $result), $expected, 'Keyword is highlighted at beginning of short string');
$expected = 'The quick brown fox & jumps over the lazy <strong>dog</strong>';
$result = $this
->doSearchExcerpt('dog', $text);
$this
->assertEqual(preg_replace('| +|', ' ', $result), $expected, 'Keyword is highlighted at end of short string');
$longtext = str_repeat(str_replace('brown', 'silver', $text) . ' ', 10) . $text . str_repeat(' ' . str_replace('brown', 'pink', $text), 10);
$result = $this
->doSearchExcerpt('brown', $longtext);
$expected = '… silver fox & jumps over the lazy dog The quick <strong>brown</strong> fox & jumps over the lazy dog The quick …';
$this
->assertEqual($result, $expected, 'Snippet around keyword in long text is correctly capped');
$longtext = str_repeat($text . ' ', 10);
$result = $this
->doSearchExcerpt('nothing', $longtext);
$expected = 'The quick brown fox & jumps over the lazy dog';
$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);
$result = $this
->doSearchExcerpt('nothing', $entities);
$this
->assertFalse(strpos($result, '&'), 'Entities are not present in excerpt');
$this
->assertTrue(strpos($result, 'í') > 0, 'Entities are converted in excerpt');
// The node body that will produce this rendered $text is:
// 123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘
$text = "<div class=\"field field--name-body field--type-text-with-summary field--label-hidden\"><div class=\"field__items\"><div class=\"field__item even\" property=\"content:encoded\"><p>123456789 HTMLTest +123456789+‘ +‘ +‘ +‘ +12345678 +‘ +‘ +‘ ‘</p>\n</div></div></div> ";
$result = $this
->doSearchExcerpt('HTMLTest', $text);
$this
->assertFalse(empty($result), 'Rendered Multi-byte HTML encodings are not corrupted in search excerpts');
}
/**
* Tests search_excerpt() with search keywords matching simplified words.
*
* Excerpting should handle keywords that are matched only after going through
* search_simplify(). This test passes keywords that match simplified words
* and compares them with strings that contain the original unsimplified word.
*/
function testSearchExcerptSimplified() {
$start_time = microtime(TRUE);
$lorem1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vitae arcu at leo cursus laoreet. Curabitur dui tortor, adipiscing malesuada tempor in, bibendum ac diam. Cras non tellus a libero pellentesque condimentum. What is a Drupalism? Suspendisse ac lacus libero. Ut non est vel nisl faucibus interdum nec sed leo. Pellentesque sem risus, vulputate eu semper eget, auctor in libero.';
$lorem2 = 'Ut fermentum est vitae metus convallis scelerisque. Phasellus pellentesque rhoncus tellus, eu dignissim purus posuere id. Quisque eu fringilla ligula. Morbi ullamcorper, lorem et mattis egestas, tortor neque pretium velit, eget eleifend odio turpis eu purus. Donec vitae metus quis leo pretium tincidunt a pulvinar sem. Morbi adipiscing laoreet mauris vel placerat. Nullam elementum, nisl sit amet scelerisque malesuada, dolor nunc hendrerit quam, eu ultrices erat est in orci.';
// Make some text with some keywords that will get simplified.
$text = $lorem1 . ' Number: 123456.7890 Hyphenated: one-two abc,def ' . $lorem2;
// Note: The search_excerpt() function adds some extra spaces -- not
// important for HTML formatting. Remove these for comparison.
$result = $this
->doSearchExcerpt('123456.7890', $text);
$this
->assertTrue(strpos($result, 'Number: <strong>123456.7890</strong>') !== FALSE, 'Numeric keyword is highlighted with exact match');
$result = $this
->doSearchExcerpt('1234567890', $text);
$this
->assertTrue(strpos($result, 'Number: <strong>123456.7890</strong>') !== FALSE, 'Numeric keyword is highlighted with simplified match');
$result = $this
->doSearchExcerpt('Number 1234567890', $text);
$this
->assertTrue(strpos($result, '<strong>Number</strong>: <strong>123456.7890</strong>') !== FALSE, 'Punctuated and numeric keyword is highlighted with simplified match');
$result = $this
->doSearchExcerpt('"Number 1234567890"', $text);
$this
->assertTrue(strpos($result, '<strong>Number: 123456.7890</strong>') !== FALSE, 'Phrase with punctuated and numeric keyword is highlighted with simplified match');
$result = $this
->doSearchExcerpt('"Hyphenated onetwo"', $text);
$this
->assertTrue(strpos($result, '<strong>Hyphenated: one-two</strong>') !== FALSE, 'Phrase with punctuated and hyphenated keyword is highlighted with simplified match');
$result = $this
->doSearchExcerpt('"abc def"', $text);
$this
->assertTrue(strpos($result, '<strong>abc,def</strong>') !== FALSE, 'Phrase with keyword simplified into two separate words is highlighted with simplified match');
// Test phrases with characters which are being truncated.
$result = $this
->doSearchExcerpt('"ipsum _"', $text);
$this
->assertTrue(strpos($result, '<strong>ipsum</strong>') !== FALSE, 'Only valid part of the phrase is highlighted and invalid part containing "_" is ignored.');
$result = $this
->doSearchExcerpt('"ipsum 0000"', $text);
$this
->assertTrue(strpos($result, '<strong>ipsum</strong>') !== FALSE, 'Only valid part of the phrase is highlighted and invalid part "0000" is ignored.');
// Test combination of the valid keyword and keyword containing only
// characters which are being truncated during simplification.
$result = $this
->doSearchExcerpt('ipsum _', $text);
$this
->assertTrue(strpos($result, '<strong>ipsum</strong>') !== FALSE, 'Only valid keyword is highlighted and invalid keyword "_" is ignored.');
$result = $this
->doSearchExcerpt('ipsum 0000', $text);
$this
->assertTrue(strpos($result, '<strong>ipsum</strong>') !== FALSE, 'Only valid keyword is highlighted and invalid keyword "0000" is ignored.');
// Test using the hook_search_preprocess() from the test module.
// The hook replaces "finding" or "finds" with "find".
// So, if we search for "find" or "finds" or "finding", we should
// highlight "finding".
$text = "this tests finding a string";
$result = $this
->doSearchExcerpt('finds', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>finding</strong>') !== FALSE, 'Search excerpt works with preprocess hook, search for finds');
$result = $this
->doSearchExcerpt('find', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>finding</strong>') !== FALSE, 'Search excerpt works with preprocess hook, search for find');
// Just to be sure, test with the replacement at the beginning and end.
$text = "finding at the beginning";
$result = $this
->doSearchExcerpt('finds', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>finding</strong>') !== FALSE, 'Search excerpt works with preprocess hook, text at start');
$text = "at the end finding";
$result = $this
->doSearchExcerpt('finds', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>finding</strong>') !== FALSE, 'Search excerpt works with preprocess hook, text at end');
// Testing with a one-to-many replacement: the test module replaces DIC
// with Dependency Injection Container.
$text = "something about the DIC is happening";
$result = $this
->doSearchExcerpt('Dependency', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>DIC</strong>') !== FALSE, 'Search excerpt works with preprocess hook, acronym first word');
$result = $this
->doSearchExcerpt('Injection', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>DIC</strong>') !== FALSE, 'Search excerpt works with preprocess hook, acronym second word');
$result = $this
->doSearchExcerpt('Container', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>DIC</strong>') !== FALSE, 'Search excerpt works with preprocess hook, acronym third word');
// Testing with a many-to-one replacement: the test module replaces
// hypertext markup language with HTML.
$text = "we always use hypertext markup language to describe things";
$result = $this
->doSearchExcerpt('html', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>hypertext markup language</strong>') !== FALSE, 'Search excerpt works with preprocess hook, acronym many to one');
// Test with accents and caps in a longer piece of text with the target
// near the end.
$text = str_repeat($lorem2, 20) . ' ' . $lorem1;
$result = $this
->doSearchExcerpt('Lìbêró', $text);
$this
->assertTrue(strpos($result, '<strong>libero</strong>') !== FALSE, 'Search excerpt works with caps and accents in longer text');
// Test with an acronym provided by the hook, with the target text in the
// middle of a long string.
$text = str_repeat($lorem2, 10) . ' DIC ' . str_repeat($lorem2, 10);
$result = $this
->doSearchExcerpt('Dependency', $text, 'ex');
$this
->assertTrue(strpos($result, '<strong>DIC</strong>') !== FALSE, 'Search excerpt works with acronym in longer text');
// Test a long string with a lot of whitespace in it.
$lorem3 = str_replace(' ', str_repeat(" \n", 20), $lorem2);
$text = str_repeat($lorem3, 20) . ' ' . $lorem1;
$result = $this
->doSearchExcerpt('Lìbêró', $text);
$this
->assertTrue(strpos($result, '<strong>libero</strong>') !== FALSE, 'Search excerpt works with caps and accents in longer text with whitespace');
$this
->verbose('Elapsed time: ' . (microtime(TRUE) - $start_time));
}
/**
* Calls search_excerpt() and renders output.
*
* @param string $keys
* A string containing a search query.
* @param string $render_array
* The text to extract fragments from.
* @param string|null $langcode
* Language code for the language of $text, if known.
*
* @return string
* A string containing HTML for the excerpt.
*/
protected function doSearchExcerpt($keys, $render_array, $langcode = NULL) {
$render_array = search_excerpt($keys, $render_array, $langcode);
$text = \Drupal::service('renderer')
->renderPlain($render_array);
// The search_excerpt() function adds some extra spaces -- not
// important for HTML formatting or this test. Remove these for comparison.
return preg_replace('| +|', ' ', $text);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AssertContentTrait:: |
protected | property | The current raw content. | |
AssertContentTrait:: |
protected | property | The drupalSettings value from the current raw $content. | |
AssertContentTrait:: |
protected | property | The XML structure parsed from the current raw $content. | 2 |
AssertContentTrait:: |
protected | property | The plain-text content of raw $content (text nodes). | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS found escaped on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given name or ID. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given ID and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists with the given name and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists in the current page by the given XPath. | |
AssertContentTrait:: |
protected | function | Asserts that a checkbox field in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a field exists in the current page with a given Xpath result. | |
AssertContentTrait:: |
protected | function | Passes if a link with the specified label is found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href (part) is found. | |
AssertContentTrait:: |
protected | function | Asserts that each HTML ID is used for just a single element. | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS NOT found escaped on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given name or ID. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given ID and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist with the given name and value. | |
AssertContentTrait:: |
protected | function | Asserts that a field does not exist or its value does not match, by XPath. | |
AssertContentTrait:: |
protected | function | Asserts that a checkbox field in the current page is not checked. | |
AssertContentTrait:: |
protected | function | Passes if a link with the specified label is not found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href (part) is not found. | |
AssertContentTrait:: |
protected | function | Passes if a link containing a given href is not found in the main region. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page does not exist. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is not checked. | |
AssertContentTrait:: |
protected | function | Triggers a pass if the perl regex pattern is not found in raw content. | |
AssertContentTrait:: |
protected | function | Passes if the raw text is NOT found on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Passes if the page (with HTML stripped) does not contains the text. | |
AssertContentTrait:: |
protected | function | Pass if the page title is not the given string. | |
AssertContentTrait:: |
protected | function | Passes if the text is found MORE THAN ONCE on the text version of the page. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page exists. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page is checked. | |
AssertContentTrait:: |
protected | function | Asserts that a select option in the current page exists. | |
AssertContentTrait:: |
protected | function | Triggers a pass if the Perl regex pattern is found in the raw content. | |
AssertContentTrait:: |
protected | function | Passes if the raw text IS found on the loaded page, fail otherwise. | |
AssertContentTrait:: |
protected | function | Passes if the page (with HTML stripped) contains the text. | |
AssertContentTrait:: |
protected | function | Helper for assertText and assertNoText. | |
AssertContentTrait:: |
protected | function | Asserts that a Perl regex pattern is found in the plain-text content. | |
AssertContentTrait:: |
protected | function | Asserts themed output. | |
AssertContentTrait:: |
protected | function | Pass if the page title is the given string. | |
AssertContentTrait:: |
protected | function | Passes if the text is found ONLY ONCE on the text version of the page. | |
AssertContentTrait:: |
protected | function | Helper for assertUniqueText and assertNoUniqueText. | |
AssertContentTrait:: |
protected | function | Builds an XPath query. | |
AssertContentTrait:: |
protected | function | Helper: Constructs an XPath for the given set of attributes and value. | |
AssertContentTrait:: |
protected | function | Searches elements using a CSS selector in the raw content. | |
AssertContentTrait:: |
protected | function | Get all option elements, including nested options, in a select. | |
AssertContentTrait:: |
protected | function | Gets the value of drupalSettings for the currently-loaded page. | |
AssertContentTrait:: |
protected | function | Gets the current raw content. | |
AssertContentTrait:: |
protected | function | Get the selected value from a select field. | |
AssertContentTrait:: |
protected | function | Retrieves the plain-text content from the current raw content. | |
AssertContentTrait:: |
protected | function | Get the current URL from the cURL handler. | 1 |
AssertContentTrait:: |
protected | function | Parse content returned from curlExec using DOM and SimpleXML. | |
AssertContentTrait:: |
protected | function | Removes all white-space between HTML tags from the raw content. | |
AssertContentTrait:: |
protected | function | Sets the value of drupalSettings for the currently-loaded page. | |
AssertContentTrait:: |
protected | function | Sets the raw content (e.g. HTML). | |
AssertContentTrait:: |
protected | function | Performs an xpath search on the contents of the internal browser. | |
AssertHelperTrait:: |
protected | function | Casts MarkupInterface objects into strings. | |
KernelTestBase:: |
protected | property | The configuration directories for this test run. | |
KernelTestBase:: |
protected | property | A KeyValueMemoryFactory instance to use when building the container. | |
KernelTestBase:: |
private | property | ||
KernelTestBase:: |
protected | property | Array of registered stream wrappers. | |
KernelTestBase:: |
private | property | ||
KernelTestBase:: |
protected | function |
Act on global state information before the environment is altered for a test. Overrides TestBase:: |
|
KernelTestBase:: |
public | function | Sets up the base service container for this test. | 12 |
KernelTestBase:: |
protected | function | Provides the data for setting the default language on the container. | 1 |
KernelTestBase:: |
protected | function | Disables modules for this test. | |
KernelTestBase:: |
protected | function | Enables modules for this test. | |
KernelTestBase:: |
protected | function | Installs default configuration for a given list of modules. | |
KernelTestBase:: |
protected | function | Installs the storage schema for a specific entity type. | |
KernelTestBase:: |
protected | function | Installs a specific table from a module schema definition. | |
KernelTestBase:: |
protected | function | Create and set new configuration directories. | 1 |
KernelTestBase:: |
protected | function | Registers a stream wrapper for this test. | |
KernelTestBase:: |
protected | function | Renders a render array. | |
KernelTestBase:: |
protected | function |
Performs setup tasks before each individual test method is run. Overrides TestBase:: |
|
KernelTestBase:: |
protected | function |
Performs cleanup tasks after each individual test method has been run. Overrides TestBase:: |
|
KernelTestBase:: |
function |
Constructor for Test. Overrides TestBase:: |
||
RandomGeneratorTrait:: |
protected | property | The random generator. | |
RandomGeneratorTrait:: |
protected | function | Gets the random generator for the utility methods. | |
RandomGeneratorTrait:: |
protected | function | Generates a unique random string containing letters and numbers. | |
RandomGeneratorTrait:: |
public | function | Generates a random PHP object. | |
RandomGeneratorTrait:: |
public | function | Generates a pseudo-random string of ASCII characters of codes 32 to 126. | |
RandomGeneratorTrait:: |
public | function | Callback for random string validation. | |
SearchExcerptTest:: |
public static | property |
Modules to enable. Overrides KernelTestBase:: |
|
SearchExcerptTest:: |
protected | function | Calls search_excerpt() and renders output. | |
SearchExcerptTest:: |
function | Tests search_excerpt() with several simulated search keywords. | ||
SearchExcerptTest:: |
function | Tests search_excerpt() with search keywords matching simplified words. | ||
SessionTestTrait:: |
protected | property | The name of the session cookie. | |
SessionTestTrait:: |
protected | function | Generates a session cookie name. | |
SessionTestTrait:: |
protected | function | Returns the session name in use on the child site. | |
TestBase:: |
protected | property | Assertions thrown in that test case. | |
TestBase:: |
protected | property | The config importer that can used in a test. | 5 |
TestBase:: |
protected static | property | An array of config object names that are excluded from schema checking. | |
TestBase:: |
protected | property | The dependency injection container used in the test. | |
TestBase:: |
protected | property | The database prefix of this test run. | |
TestBase:: |
public | property | Whether to die in case any test assertion fails. | |
TestBase:: |
protected | property | HTTP authentication credentials (<username>:<password>). | |
TestBase:: |
protected | property | HTTP authentication method (specified as a CURLAUTH_* constant). | |
TestBase:: |
protected | property | The DrupalKernel instance used in the test. | 1 |
TestBase:: |
protected | property | The original configuration (variables), if available. | |
TestBase:: |
protected | property | The original configuration (variables). | |
TestBase:: |
protected | property | The original configuration directories. | |
TestBase:: |
protected | property | The original container. | |
TestBase:: |
protected | property | The original file directory, before it was changed for testing purposes. | |
TestBase:: |
protected | property | The original language. | |
TestBase:: |
protected | property | The original database prefix when running inside Simpletest. | |
TestBase:: |
protected | property | The original installation profile. | |
TestBase:: |
protected | property | The name of the session cookie of the test-runner. | |
TestBase:: |
protected | property | The settings array. | |
TestBase:: |
protected | property | The original array of shutdown function callbacks. | 1 |
TestBase:: |
protected | property | The site directory of the original parent site. | |
TestBase:: |
protected | property | The original user, before testing began. | 1 |
TestBase:: |
protected | property | The private file directory for the test environment. | |
TestBase:: |
protected | property | The public file directory for the test environment. | |
TestBase:: |
public | property | Current results of this test case. | |
TestBase:: |
protected | property | The site directory of this test run. | |
TestBase:: |
protected | property | This class is skipped when looking for the source of an assertion. | |
TestBase:: |
protected | property | Set to TRUE to strict check all configuration saved. | 4 |
TestBase:: |
protected | property | The temporary file directory for the test environment. | |
TestBase:: |
protected | property | The test run ID. | |
TestBase:: |
protected | property | Time limit for the test. | |
TestBase:: |
protected | property | The translation file directory for the test environment. | |
TestBase:: |
public | property | TRUE if verbose debugging is enabled. | |
TestBase:: |
protected | property | Safe class name for use in verbose output filenames. | |
TestBase:: |
protected | property | Directory where verbose output files are put. | |
TestBase:: |
protected | property | URL to the verbose output file directory. | |
TestBase:: |
protected | property | Incrementing identifier for verbose output filenames. | |
TestBase:: |
protected | function | Internal helper: stores the assert. | |
TestBase:: |
protected | function | Check to see if two values are equal. | |
TestBase:: |
protected | function | Asserts that a specific error has been logged to the PHP error log. | |
TestBase:: |
protected | function | Check to see if a value is false. | |
TestBase:: |
protected | function | Check to see if two values are identical. | |
TestBase:: |
protected | function | Checks to see if two objects are identical. | |
TestBase:: |
protected | function | Asserts that no errors have been logged to the PHP error.log thus far. | |
TestBase:: |
protected | function | Check to see if two values are not equal. | |
TestBase:: |
protected | function | Check to see if two values are not identical. | |
TestBase:: |
protected | function | Check to see if a value is not NULL. | |
TestBase:: |
protected | function | Check to see if a value is NULL. | |
TestBase:: |
protected | function | Check to see if a value is not false. | |
TestBase:: |
private | function | Changes the database connection to the prefixed one. | |
TestBase:: |
protected | function | Checks the matching requirements for Test. | 2 |
TestBase:: |
protected | function | Configuration accessor for tests. Returns non-overridden configuration. | |
TestBase:: |
public | function | Returns a ConfigImporter object to import test importing of configuration. | 5 |
TestBase:: |
public | function | Copies configuration objects from source storage to target storage. | |
TestBase:: |
public static | function | Delete an assertion record by message ID. | |
TestBase:: |
protected | function | Fire an error assertion. | 3 |
TestBase:: |
public | function | Handle errors during test runs. | |
TestBase:: |
protected | function | Handle exceptions. | |
TestBase:: |
protected | function | Fire an assertion that is always negative. | |
TestBase:: |
public static | function | Ensures test files are deletable within file_unmanaged_delete_recursive(). | |
TestBase:: |
public static | function | Converts a list of possible parameters into a stack of permutations. | |
TestBase:: |
protected | function | Cycles through backtrace until the first non-assertion method is found. | |
TestBase:: |
protected | function | Gets the config schema exclusions for this test. | |
TestBase:: |
public static | function | Returns the database connection to the site running Simpletest. | |
TestBase:: |
public | function | Gets the database prefix. | |
TestBase:: |
public | function | Gets the temporary files directory. | |
TestBase:: |
public static | function | Store an assertion from outside the testing context. | |
TestBase:: |
protected | function | Fire an assertion that is always positive. | |
TestBase:: |
private | function | Generates a database prefix for running tests. | |
TestBase:: |
private | function | Prepares the current environment for running the test. | |
TestBase:: |
private | function | Cleans up the test environment and restores the original environment. | |
TestBase:: |
public | function | Run all tests in this class. | 1 |
TestBase:: |
protected | function | Changes in memory settings. | |
TestBase:: |
protected | function | Helper method to store an assertion record in the configured database. | |
TestBase:: |
protected | function | Logs a verbose message in a text file. |