Drupal 8  8.0.2
AttachedAssetsTest Class Reference
Inheritance diagram for AttachedAssetsTest:

Public Member Functions

 testDefault ()
 
 testLibraryUnknown ()
 
 testAddFiles ()
 
 testAddJsSettings ()
 
 testAddExternalFiles ()
 
 testAttributes ()
 
 testAggregatedAttributes ()
 
 testAggregation ()
 
 testSettings ()
 
 testHeaderHTML ()
 
 testNoCache ()
 
 testBrowserConditionalComments ()
 
 testVersionQueryString ()
 
 testRenderOrder ()
 
 testRenderDifferentWeight ()
 
 testAlter ()
 
 testAddJsFileWithQueryString ()
 

Static Public Attributes

static $modules = array('language', 'simpletest', 'common_test', 'system')
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $assetResolver
 
 $renderer
 

Detailed Description

Tests #attached assets: attached asset libraries and JavaScript settings.

i.e. tests:

$build['#attached']['library'] = …
$build['#attached']['drupalSettings'] = …

Common Asset

Member Function Documentation

setUp ( )
protected

{}

testAddExternalFiles ( )

Tests adding external CSS and JavaScript files.

References AttachedAssets\createFromRenderArray(), and Drupal\service().

Here is the call graph for this function:

testAddFiles ( )

Tests adding a CSS and a JavaScript file.

References AttachedAssets\createFromRenderArray(), file_create_url(), and Drupal\service().

Here is the call graph for this function:

testAddJsFileWithQueryString ( )

Tests JavaScript files that have querystrings attached get added right.

References AttachedAssets\createFromRenderArray(), file_create_url(), and Drupal\service().

Here is the call graph for this function:

testAddJsSettings ( )

Tests adding JavaScript settings.

References AttachedAssets\createFromRenderArray().

Here is the call graph for this function:

testAggregatedAttributes ( )

Tests that attributes are maintained when JS aggregation is enabled.

References AttachedAssets\createFromRenderArray(), file_create_url(), and Drupal\service().

Here is the call graph for this function:

testAggregation ( )

Integration test for CSS/JS aggregation.

References AttachedAssets\createFromRenderArray(), and Drupal\service().

Here is the call graph for this function:

testAlter ( )

Tests altering a JavaScript's weight via hook_js_alter().

See Also
simpletest_js_alter()

References AttachedAssets\createFromRenderArray(), and Drupal\service().

Here is the call graph for this function:

testAttributes ( )

Tests adding JavaScript files with additional attributes.

References AttachedAssets\createFromRenderArray(), file_create_url(), and Drupal\service().

Here is the call graph for this function:

testBrowserConditionalComments ( )

Tests adding JavaScript within conditional comments.

See Also
::preRenderConditionalComments()

References AttachedAssets\createFromRenderArray(), file_create_url(), and Drupal\service().

Here is the call graph for this function:

testDefault ( )

Tests that default CSS and JavaScript is empty.

testHeaderHTML ( )

Tests JS assets depending on the 'core/<head>' virtual library.

References AttachedAssets\createFromRenderArray(), file_create_url(), and Drupal\service().

Here is the call graph for this function:

testLibraryUnknown ( )

Tests non-existing libraries.

References AttachedAssets\createFromRenderArray().

Here is the call graph for this function:

testNoCache ( )

Tests that for assets with cache = FALSE, Drupal sets preprocess = FALSE.

References AttachedAssets\createFromRenderArray().

Here is the call graph for this function:

testRenderDifferentWeight ( )

Tests rendering the JavaScript with a file's weight above jQuery's.

References AttachedAssets\createFromRenderArray(), and Drupal\service().

Here is the call graph for this function:

testRenderOrder ( )

Tests JavaScript and CSS asset ordering.

References AttachedAssets\createFromRenderArray(), and Drupal\service().

Here is the call graph for this function:

testSettings ( )

Tests JavaScript settings.

References AttachedAssets\createFromRenderArray(), Json\decode(), Drupal\service(), and Unicode\substr().

Here is the call graph for this function:

testVersionQueryString ( )

Tests JavaScript versioning.

References AttachedAssets\createFromRenderArray(), and Drupal\service().

Here is the call graph for this function:

Field Documentation

$modules = array('language', 'simpletest', 'common_test', 'system')
static

{}


The documentation for this class was generated from the following file: