objectManager = Bootstrap::getObjectManager(); $this->page = $this->objectManager->get(PageFactory::class)->create(); } /** * @return void */ public function testMyDownloadableProductLink(): void { $this->preparePage(); $block = $this->page->getLayout()->getBlock('customer-account-navigation-downloadable-products-link'); $this->assertNotFalse($block); $html = $block->toHtml(); $this->assertStringContainsString('downloadable/customer/products', $html); $this->assertEquals('My Downloadable Products', strip_tags($html)); } /** * Prepare page before render * * @return void */ private function preparePage(): void { $this->page->addHandle([ 'default', 'customer_account', ]); $this->page->getLayout()->generateXml(); } }