function CacheableMetadataTest::testCreateFromRenderArray

Tests create from render array.

@legacy-covers ::createFromRenderArray

Attributes

#[DataProvider('providerTestCreateFromRenderArray')]

File

core/tests/Drupal/Tests/Core/Cache/CacheableMetadataTest.php, line 151

Class

CacheableMetadataTest
Tests Drupal\Core\Cache\CacheableMetadata.

Namespace

Drupal\Tests\Core\Cache

Code

public function testCreateFromRenderArray(array $render_array, CacheableMetadata $expected) : void {
  $this->assertEquals($expected, CacheableMetadata::createFromRenderArray($render_array));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.