/** * @dataProvider provideTestGetHtml */ public function testGetHtml(EntityView $view, EntityRevision $entityRevision, $regexp) { $output = $view->getHtml($entityRevision); $this->assertRegexp($regexp, $output); $entityId = $entityRevision->getEntity()->getId()->getSerialization(); $this->assertRegExp('/id="wb-[a-z]+-' . $entityId . '"/', $output); $this->assertContains('<div id="toc"></div>', $output); }
/** * @see EntityView::__construct * * @param TemplateFactory $templateFactory * @param EntityTermsView $entityTermsView * @param StatementSectionsView $statementSectionsView * @param Language $language * @param SiteLinksView $siteLinksView * @param string[] $siteLinkGroups */ public function __construct(TemplateFactory $templateFactory, EntityTermsView $entityTermsView, StatementSectionsView $statementSectionsView, Language $language, SiteLinksView $siteLinksView, array $siteLinkGroups) { parent::__construct($templateFactory, $entityTermsView, $language); $this->statementSectionsView = $statementSectionsView; $this->siteLinksView = $siteLinksView; $this->siteLinkGroups = $siteLinkGroups; }
/** * @param TemplateFactory $templateFactory * @param EntityTermsView $entityTermsView * @param StatementSectionsView $statementSectionsView * @param DataTypeFactory $dataTypeFactory * @param Language $language */ public function __construct(TemplateFactory $templateFactory, EntityTermsView $entityTermsView, StatementSectionsView $statementSectionsView, DataTypeFactory $dataTypeFactory, Language $language) { parent::__construct($templateFactory, $entityTermsView, $language); $this->statementSectionsView = $statementSectionsView; $this->dataTypeFactory = $dataTypeFactory; }