function CacheableMetadataTest::testCreateFromObject

Tests create from object.

@legacy-covers ::createFromObject

Attributes

#[DataProvider('providerTestCreateFromObject')]

File

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

Class

CacheableMetadataTest
Tests Drupal\Core\Cache\CacheableMetadata.

Namespace

Drupal\Tests\Core\Cache

Code

public function testCreateFromObject($object, CacheableMetadata $expected) : void {
  $this->assertEquals($expected, CacheableMetadata::createFromObject($object));
}

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