TestElementInfoManager example

return $data;
  }

  /** * @covers ::getInfoProperty */
  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'));
  }

}

/** * Provides a test custom element plugin. */
class TestElementInfoManager extends ElementInfoManager {

  
Home | Imprint | This part of the site doesn't use cookies.