Drupal PHP Cross Reference Content Management Systems

Summary: /modules/simpletest/tests/common.test - 2616 lines - 109160 bytes - Source - Print

Description: (no description)

Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 24 classes

DrupalAlterTestCase:: (3 methods):
getInfo()
setUp()
testDrupalAlter()

CommonURLUnitTest:: (10 methods):
getInfo()
testLXSS()
testLActiveClass()
testLCustomClass()
hasClass()
testDrupalGetQueryParameters()
testDrupalHttpBuildQuery()
testDrupalParseUrl()
testUrl()
testExternalUrls()

CommonXssUnitTest:: (5 methods):
getInfo()
testInvalidMultiByte()
testEscaping()
testFormatStringAndT()
testBadProtocolStripping()

CommonSizeTestCase:: (5 methods):
getInfo()
setUp()
testCommonFormatSize()
testCommonParseSize()
testCommonParseSizeFormatSize()

DrupalTagsHandlingTestCase:: (4 methods):
getInfo()
testDrupalExplodeTags()
testDrupalImplodeTags()
assertTags()

CascadingStylesheetsTestCase:: (16 methods):
getInfo()
setUp()
testDefault()
testModuleInfo()
testAddFile()
testAddExternal()
testReset()
testRenderFile()
testRenderExternal()
testRenderInlinePreprocess()
testRenderInlineNoPreprocess()
testRenderInlineFullPage()
testRenderOrder()
testRenderOverride()
testAlter()
testAddCssFileWithQueryString()

DrupalHTMLIdentifierTestCase:: (4 methods):
getInfo()
testDrupalCleanCSSIdentifier()
testDrupalHTMLClass()
testDrupalHTMLId()

CascadingStylesheetsUnitTest:: (2 methods):
getInfo()
testLoadCssBasic()

DrupalHTTPRequestTestCase:: (6 methods):
getInfo()
setUp()
testDrupalHTTPRequest()
testDrupalHTTPRequestBasicAuth()
testDrupalHTTPRequestRedirect()
testDrupalHTTPRequestHeaders()

DrupalSetContentTestCase:: (2 methods):
getInfo()
testRegions()

DrupalGotoTest:: (5 methods):
getInfo()
setUp()
testDrupalGoto()
testDrupalGotoAlter()
testDrupalGetDestination()

JavaScriptTestCase:: (26 methods):
getInfo()
setUp()
tearDown()
testDefault()
testAddFile()
testAddSetting()
testAddExternal()
testHeaderSetting()
testReset()
testAddInline()
testRenderExternal()
testFooterHTML()
testNoCache()
testDifferentGroup()
testDifferentWeight()
testAggregationOrder()
testRenderOrder()
testRenderDifferentWeight()
testAlter()
testLibraryRender()
testLibraryAlter()
testLibraryNameConflicts()
testLibraryUnknown()
testAttachedLibrary()
testGetLibrary()
testAddJsFileWithQueryString()

DrupalRenderTestCase:: (8 methods):
getInfo()
setUp()
testDrupalRenderSorting()
testDrupalRenderChildrenAttached()
testDrupalRenderThemeArguments()
testDrupalRenderFormElements()
assertRenderedElement()
testDrupalRenderCache()

ValidUrlTestCase:: (5 methods):
getInfo()
testValidAbsolute()
testInvalidAbsolute()
testValidRelative()
testInvalidRelative()

DrupalDataApiTest:: (3 methods):
getInfo()
setUp()
testDrupalWriteRecord()

DrupalErrorCollectionUnitTest:: (5 methods):
getInfo()
setUp()
testErrorCollect()
error()
assertError()

ParseInfoFilesTestCase:: (2 methods):
getInfo()
testParseInfoFile()

DrupalSystemListingTestCase:: (2 methods):
getInfo()
testDirectoryPrecedence()

FormatDateUnitTest:: (4 methods):
getInfo()
setUp()
testAdminDefinedFormatDate()
testFormatDate()

DrupalAttributesUnitTest:: (2 methods):
getInfo()
testDrupalAttributes()

DrupalJSONTest:: (2 methods):
getInfo()
testJSON()

DrupalGetRdfNamespacesTestCase:: (3 methods):
getInfo()
setUp()
testGetRdfNamespaces()

DrupalAddFeedTestCase:: (3 methods):
getInfo()
testBasicFeedAddNoTitle()
urlToRSSLinkPattern()

FeedIconTest:: (2 methods):
getInfo()
testFeedIconEscaping()

Class: DrupalAlterTestCase

Tests for URL generation functions.

getInfo()  line: 12
No description
setUp()  line: 20
No description
testDrupalAlter()  line: 24
No description

Class: CommonURLUnitTest

Tests for URL generation functions.

url() calls module_implements(), which may issue a db query, which requires
inheriting from a web test case rather than a unit test case.
getInfo()  line: 77
No description
testLXSS()  line: 85
Confirm that invalid text given as $path is filtered.

testLActiveClass()  line: 99
No description
testLCustomClass()  line: 104
Tests for custom class in l() function.

hasClass($link, $class line: 114
No description
testDrupalGetQueryParameters()  line: 118
Test drupal_get_query_parameters().

testDrupalHttpBuildQuery()  line: 165
Test drupal_http_build_query().

testDrupalParseUrl()  line: 175
Test drupal_parse_url().

testUrl()  line: 243
Test url() with/without query, with/without fragment, absolute on/off and
assert all that works when clean URLs are on and off.

testExternalUrls()  line: 319
Test external URL handling.

Class: CommonXssUnitTest

Tests for check_plain(), filter_xss(), format_string(), and check_url().

getInfo()  line: 360
No description
testInvalidMultiByte()  line: 368
Check that invalid multi-byte sequences are rejected.

testEscaping()  line: 386
Check that special characters are escaped.

testFormatStringAndT()  line: 396
Test t() and format_string() replacement functionality.

testBadProtocolStripping()  line: 412
Check that harmful protocols are stripped.

Class: CommonSizeTestCase

Tests file size parsing and formatting functions.

getInfo()  line: 434
No description
setUp()  line: 442
No description
testCommonFormatSize()  line: 465
Check that format_size() returns the expected string.

testCommonParseSize()  line: 480
Check that parse_size() returns the proper byte sizes.

testCommonParseSizeFormatSize()  line: 513
Cross-test parse_size() and format_size().

Class: DrupalTagsHandlingTestCase

Test drupal_explode_tags() and drupal_implode_tags().

getInfo()  line: 538
No description
testDrupalExplodeTags()  line: 546
Explode a series of tags.

testDrupalImplodeTags()  line: 555
Implode a series of tags.

assertTags($tags line: 568
Helper function: asserts that the ending array of tags is what we wanted.

Class: CascadingStylesheetsTestCase

Test the Drupal CSS system.

getInfo()  line: 588
No description
setUp()  line: 596
No description
testDefault()  line: 602
Check default stylesheets as empty.

testModuleInfo()  line: 609
Test that stylesheets in module .info files are loaded.

testAddFile()  line: 630
Tests adding a file stylesheet.

testAddExternal()  line: 639
Tests adding an external stylesheet.

testReset()  line: 648
Makes sure that reseting the CSS empties the cache.

testRenderFile()  line: 656
Tests rendering the stylesheets.

testRenderExternal()  line: 666
Tests rendering an external stylesheet.

testRenderInlinePreprocess()  line: 678
Tests rendering inline stylesheets with preprocessing on.

testRenderInlineNoPreprocess()  line: 689
Tests rendering inline stylesheets with preprocessing off.

testRenderInlineFullPage()  line: 699
Tests rendering inline stylesheets through a full page request.

testRenderOrder()  line: 729
Test CSS ordering.

testRenderOverride()  line: 762
Test CSS override.

testAlter()  line: 786
Tests Locale module's CSS Alter to include RTL overrides.

testAddCssFileWithQueryString()  line: 804
Tests that the query string remains intact when adding CSS files that have
query string parameters.

Class: DrupalHTMLIdentifierTestCase

Test for cleaning HTML identifiers.

getInfo()  line: 820
No description
testDrupalCleanCSSIdentifier()  line: 828
Tests that drupal_clean_css_identifier() cleans the identifier properly.

testDrupalHTMLClass()  line: 844
Tests that drupal_html_class() cleans the class name properly.

testDrupalHTMLId()  line: 852
Tests that drupal_html_id() cleans the ID properly.

Class: CascadingStylesheetsUnitTest

CSS Unit Tests.

getInfo()  line: 880
No description
testLoadCssBasic()  line: 888
Tests basic CSS loading with and without optimization via drupal_load_stylesheet().

Known tests:
- Retain white-space in selectors. (http://drupal.org/node/472820)
- Proper URLs in imported files. (http://drupal.org/node/265719)
- Retain pseudo-selectors. (http://drupal.org/node/460448)

Class: DrupalHTTPRequestTestCase

Test drupal_http_request().

getInfo()  line: 932
No description
setUp()  line: 940
No description
testDrupalHTTPRequest()  line: 944
No description
testDrupalHTTPRequestBasicAuth()  line: 987
No description
testDrupalHTTPRequestRedirect()  line: 1000
No description
testDrupalHTTPRequestHeaders()  line: 1039
Tests Content-language headers generated by Drupal.

Class: DrupalSetContentTestCase

Testing drupal_add_region_content and drupal_get_region_content.

getInfo()  line: 1060
No description
testRegions()  line: 1069
Test setting and retrieving content for theme regions.

Class: DrupalGotoTest

Testing drupal_goto and hook_drupal_goto_alter().

getInfo()  line: 1106
No description
setUp()  line: 1114
No description
testDrupalGoto()  line: 1118
Test drupal_goto().

testDrupalGotoAlter()  line: 1144
Test hook_drupal_goto_alter().

testDrupalGetDestination()  line: 1154
Test drupal_get_destination().

Class: JavaScriptTestCase

Tests for the JavaScript system.

getInfo()  line: 1175
Store configured value for JavaScript preprocessing.

setUp()  line: 1188
No description
tearDown()  line: 1201
No description
testDefault()  line: 1207
Test default JavaScript is empty.

testAddFile()  line: 1214
Test adding a JavaScript file.

testAddSetting()  line: 1227
Test adding settings.

testAddExternal()  line: 1236
Tests adding an external JavaScript File.

testHeaderSetting()  line: 1245
Test drupal_get_js() for JavaScript settings.

testReset()  line: 1280
Test to see if resetting the JavaScript empties the cache.

testAddInline()  line: 1289
Test adding inline scripts.

testRenderExternal()  line: 1300
Test rendering an external JavaScript file.

testFooterHTML()  line: 1311
Test drupal_get_js() with a footer scope.

testNoCache()  line: 1321
Test drupal_add_js() sets preproccess to false when cache is set to false.

testDifferentGroup()  line: 1329
Test adding a JavaScript file with a different group.

testDifferentWeight()  line: 1337
Test adding a JavaScript file with a different weight.

testAggregationOrder()  line: 1345
Tests JavaScript aggregation when files are added to a different scope.

testRenderOrder()  line: 1387
Test JavaScript ordering.

testRenderDifferentWeight()  line: 1429
Test rendering the JavaScript with a file's weight above jQuery's.

testAlter()  line: 1441
Test altering a JavaScript's weight via hook_js_alter().

testLibraryRender()  line: 1458
Adds a library to the page and tests for both its JavaScript and its CSS.

testLibraryAlter()  line: 1470
Adds a JavaScript library to the page and alters it.

testLibraryNameConflicts()  line: 1486
Tests that multiple modules can implement the same library.

testLibraryUnknown()  line: 1496
Tests non-existing libraries.

testAttachedLibrary()  line: 1510
Tests the addition of libraries through the #attached['library'] property.

testGetLibrary()  line: 1520
Tests retrieval of libraries via drupal_get_library().

testAddJsFileWithQueryString()  line: 1540
Tests that the query string remains intact when adding JavaScript files
that have query string parameters.

Class: DrupalRenderTestCase

Tests for drupal_render().

getInfo()  line: 1555
No description
setUp()  line: 1563
No description
testDrupalRenderSorting()  line: 1567
Test sorting by weight.

testDrupalRenderChildrenAttached()  line: 1618
Test #attached functionality in children elements.

testDrupalRenderThemeArguments()  line: 1668
Test passing arguments to the theme function.

testDrupalRenderFormElements()  line: 1686
Test rendering form elements without passing through form_builder().

assertRenderedElement(array $element, $xpath, array $xpath_args = array()  line: 1796
No description
testDrupalRenderCache()  line: 1812
Tests caching of an empty render item.

Class: ValidUrlTestCase

Test for valid_url().

getInfo()  line: 1848
No description
testValidAbsolute()  line: 1856
Test valid absolute URLs.

testInvalidAbsolute()  line: 1891
Test invalid absolute URLs.

testValidRelative()  line: 1911
Test valid relative URLs.

testInvalidRelative()  line: 1932
Test invalid relative URLs.

Class: DrupalDataApiTest

Tests for CRUD API functions.

getInfo()  line: 1956
No description
setUp()  line: 1964
No description
testDrupalWriteRecord()  line: 1968
Test the drupal_write_record() API function.

Class: DrupalErrorCollectionUnitTest

Tests Simpletest error and exception collector.

getInfo()  line: 2088
Errors triggered during the test.

Errors are intercepted by the overriden implementation
of DrupalWebTestCase::error below.

setUp()  line: 2106
No description
testErrorCollect()  line: 2110
Test that simpletest collects errors from the tested site.

error($message = '', $group = 'Other', array $caller = NULL)  line: 2131
Error handler that collects errors in an array.

This test class is trying to verify that simpletest correctly sees errors
and warnings. However, it can't generate errors and warnings that
propagate up to the testing framework itself, or these tests would always
fail. So, this special copy of error() doesn't propagate the errors up
the class hierarchy. It just stuffs them into a protected collectedErrors
array for various assertions to inspect.
assertError($error, $group, $function, $file, $message = NULL)  line: 2161
Assert that a collected error matches what we are expecting.

Class: ParseInfoFilesTestCase

Test the drupal_parse_info_file() API function.

getInfo()  line: 2178
No description
testParseInfoFile()  line: 2186
Parse an example .info file an verify the results.

Class: DrupalSystemListingTestCase

Tests for the drupal_system_listing() function.

getInfo()  line: 2201
Use the testing profile; this is needed for testDirectoryPrecedence().

testDirectoryPrecedence()  line: 2214
Test that files in different directories take precedence as expected.

Class: FormatDateUnitTest

Tests for the format_date() function.

getInfo()  line: 2262
Arbitrary langcode for a custom language.

setUp()  line: 2275
No description
testAdminDefinedFormatDate()  line: 2288
Test admin-defined formats in format_date().

testFormatDate()  line: 2314
Tests for the format_date() function.

Class: DrupalAttributesUnitTest

Tests for the format_date() function.

getInfo()  line: 2377
No description
testDrupalAttributes()  line: 2385
Tests that drupal_html_class() cleans the class name properly.

Class: DrupalJSONTest

Tests converting PHP variables to JSON strings and back.

getInfo()  line: 2417
No description
testJSON()  line: 2425
Tests converting PHP variables to JSON strings and back.

Class: DrupalGetRdfNamespacesTestCase

Tests for RDF namespaces XML serialization.

getInfo()  line: 2481
No description
setUp()  line: 2489
No description
testGetRdfNamespaces()  line: 2493
Test RDF namespaces.

Class: DrupalAddFeedTestCase

Basic tests for drupal_add_feed().

getInfo()  line: 2513
No description
testBasicFeedAddNoTitle()  line: 2521
Test drupal_add_feed() with paths, URLs, and titles.

urlToRSSLinkPattern($url, $title = '')  line: 2580
Create a pattern representing the RSS feed in the page.

Class: FeedIconTest

Test for theme_feed_icon().

getInfo()  line: 2596
No description
testFeedIconEscaping()  line: 2604
Check that special characters are correctly escaped. Test for issue #1211668.

title

Body