Commit 3bd42a27 authored by alexpott's avatar alexpott

Issue #2601790 by Liam Morland: In AttachedAssetsTest.php, separate a 3-part...

Issue #2601790 by Liam Morland: In AttachedAssetsTest.php, separate a 3-part test into 3 separate test assertions
parent d0b0b4a5
......@@ -184,12 +184,9 @@ function testAggregation() {
list($header_js, $footer_js) = $this->assetResolver->getJsAssets($assets, TRUE);
$this->assertEqual([], \Drupal::service('asset.js.collection_renderer')->render($header_js), 'There are 0 JavaScript assets in the header.');
$rendered_footer_js = \Drupal::service('asset.js.collection_renderer')->render($footer_js);
$this->assertTrue(
count($rendered_footer_js) == 2
&& $rendered_footer_js[0]['#attributes']['data-drupal-selector'] === 'drupal-settings-json'
&& substr($rendered_footer_js[1]['#attributes']['src'], 0, 7) === 'http://',
'There are 2 JavaScript assets in the footer: one with drupal settings, one with the sole aggregated JavaScript asset.'
);
$this->assertEqual(2, count($rendered_footer_js), 'There are 2 JavaScript assets in the footer.');
$this->assertEqual('drupal-settings-json', $rendered_footer_js[0]['#attributes']['data-drupal-selector'], 'The first of the two JavaScript assets in the footer has drupal settings.');
$this->assertEqual('http://', substr($rendered_footer_js[1]['#attributes']['src'], 0, 7), 'The second of the two JavaScript assets in the footer has the sole aggregated JavaScript asset.');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment