public function ElementInfoManagerTest::testGetInfoProperty in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php \Drupal\Tests\Core\Render\ElementInfoManagerTest::testGetInfoProperty()
- 9 core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php \Drupal\Tests\Core\Render\ElementInfoManagerTest::testGetInfoProperty()
@covers ::getInfoProperty
File
- core/
tests/ Drupal/ Tests/ Core/ Render/ ElementInfoManagerTest.php, line 146 - Contains \Drupal\Tests\Core\Render\ElementInfoManagerTest.
Class
- ElementInfoManagerTest
- @coversDefaultClass \Drupal\Core\Render\ElementInfoManager @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function testGetInfoProperty() {
$this->themeManager
->method('getActiveTheme')
->willReturn(new ActiveTheme([
'name' => 'test',
]));
$element_info = new TestElementInfoManager(new \ArrayObject(), $this->cache, $this->cacheTagsInvalidator, $this->moduleHandler, $this->themeManager);
$this
->assertSame('baz', $element_info
->getInfoProperty('foo', '#bar'));
$this
->assertNull($element_info
->getInfoProperty('foo', '#non_existing_property'));
$this
->assertSame('qux', $element_info
->getInfoProperty('foo', '#non_existing_property', 'qux'));
}