function ComponentMetadataTest::testMetadata
Same name in this branch
- 10 core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php \Drupal\Tests\Core\Theme\Component\ComponentMetadataTest::testMetadata()
Same name in other branches
- 11.x core/modules/sdc/tests/src/Unit/ComponentMetadataTest.php \Drupal\Tests\sdc\Unit\ComponentMetadataTest::testMetadata()
- 11.x core/tests/Drupal/Tests/Core/Theme/Component/ComponentMetadataTest.php \Drupal\Tests\Core\Theme\Component\ComponentMetadataTest::testMetadata()
Tests that the correct data is returned for each property.
@dataProvider dataProviderMetadata
File
-
core/
modules/ sdc/ tests/ src/ Unit/ ComponentMetadataTest.php, line 26
Class
- ComponentMetadataTest
- Unit tests for the component metadata class.
Namespace
Drupal\Tests\sdc\UnitCode
public function testMetadata(array $metadata_info, array $expectations) {
$metadata = new ComponentMetadata($metadata_info, 'foo/', FALSE);
$this->assertSame($expectations['path'], $metadata->path);
$this->assertSame($expectations['status'], $metadata->status);
$this->assertSame($expectations['thumbnail'], $metadata->getThumbnailPath());
$this->assertEquals($expectations['props'], $metadata->schema);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.