diff --git a/core/includes/common.inc b/core/includes/common.inc index 4bee797..367f91e 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -4389,7 +4389,7 @@ function _drupal_render_process_post_render_cache(array &$elements) { * drupal_render()ed). On top of that, the theme system transforms render arrays * into HTML strings. These two facts combined imply that it is impossible for * #post_render_cache callbacks to bubble up to the root of the render array. - * Therefor, drupal_render_collect_post_render_cache() must be called *before* + * Therefore, drupal_render_collect_post_render_cache() must be called *before* * #theme callbacks, so that it has a chance to examine the full render array. * In short: in order to examine the full render array for #post_render_cache * callbacks, it must use post-order tree traversal, whereas drupal_render() diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index 70c2b0c..38b6da0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -816,9 +816,9 @@ function testDrupalRenderRenderCachePlaceholder() { $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); - $this->assertTrue($nodes->length > 0, 'The token attribute was found in the cached markup'); + $this->assertTrue($nodes->length, 'The token attribute was found in the cached markup'); $token = ''; - if ($nodes->length > 0) { + if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical'); @@ -906,9 +906,9 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); - $this->assertTrue($nodes->length > 0, 'The token attribute was found in the cached child element markup'); + $this->assertTrue($nodes->length, 'The token attribute was found in the cached child element markup'); $token = ''; - if ($nodes->length > 0) { + if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical for the child element'); @@ -930,9 +930,9 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); - $this->assertTrue($nodes->length > 0, 'The token attribute was found in the cached parent element markup'); + $this->assertTrue($nodes->length, 'The token attribute was found in the cached parent element markup'); $token = ''; - if ($nodes->length > 0) { + if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical for the parent element'); @@ -958,9 +958,9 @@ function testDrupalRenderChildElementRenderCachePlaceholder() { $dom = Html::load($cached_element['#markup']); $xpath = new \DOMXPath($dom); $nodes = $xpath->query('//*[@token]'); - $this->assertTrue($nodes->length > 0, 'The token attribute was found in the cached child element markup'); + $this->assertTrue($nodes->length, 'The token attribute was found in the cached child element markup'); $token = ''; - if ($nodes->length > 0) { + if ($nodes->length) { $token = $nodes->item(0)->getAttribute('token'); } $this->assertIdentical($token, $expected_token, 'The tokens are identical for the child element');