Discovered in #2395853: Split system.module.css and system.theme.css files into SMACSS style components - see the changes it makes to SearchQueryAlterTest.

Dumping the result of AssertContentTrait::getTextContent() reveals it contains:

@import url("http://drupal8alt.dev/core/assets/vendor/normalize-css/normalize.css?nsnjb3");
@import url("http://drupal8alt.dev/core/modules/system/css/components/ajax-progress.module.css?nsnjb3");
@import url("http://drupal8alt.dev/core/modules/system/css/components/align.module.css?nsnjb3");
@import url("http://drupal8alt.dev/core/modules/system/css/components/autocomplete-loading.module.css?nsnjb3");
@import url("http://drupal8alt.dev/core/modules/system/css/components/fieldgroup.module.css?nsnjb3");
@import url("http://drupal8alt.dev/core/modules/system/css/components/container-inline.module.css?nsnjb3");
@import url("http://drupal8alt.dev/core/modules/system/css/components/clearfix.module.css?nsnjb3");

That should not be there.

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new1.22 KB
new2 KB
dawehner’s picture

+++ b/core/modules/simpletest/src/AssertContentTrait.php
@@ -76,7 +76,10 @@ protected function setRawContent($content) {
+      // Strip everything between the HEAD tags.
+      $raw_content = preg_replace('@<head>(.+?)</head>@si', '', $raw_content);

What about just use the stuff inside the body tag instead?

alexpott’s picture

re #3 Well that assumes a body tag has been used.... perhaps setRawContent was used to set theme output.

dawehner’s picture

+++ b/core/modules/simpletest/tests/src/Unit/AssertContentTraitTest.php
@@ -0,0 +1,50 @@
+
+  public function testGetTextContent() {

Let's add the @covers ::getTextContent method or did you skipped that because of the protected method?

The last submitted patch, 2: 2546582.2.test-only.patch, failed testing.

alexpott’s picture

StatusFileSize
new847 bytes
new2.11 KB

Thanks @dawehner

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Nice discovery!

Patch looks great. My only question was identical to #3, and already answered in #4.

dawehner’s picture

+1

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.0.x. Thanks!

  • webchick committed d52fc74 on 8.0.x
    Issue #2546582 by alexpott, dawehner: AssertContentTrait::getTextContent...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.