public function testGetCommentsHtml() { $childBlock = $this->_layout->addBlock('Magento\\Framework\\View\\Element\\Text', 'creditmemo_comments', 'block'); $expectedHtml = '<b>Any html</b>'; $this->assertEmpty($childBlock->getEntity()); $this->assertEmpty($childBlock->getTitle()); $this->assertNotEquals($expectedHtml, $this->_block->getCommentsHtml($this->_creditmemo)); $childBlock->setText($expectedHtml); $actualHtml = $this->_block->getCommentsHtml($this->_creditmemo); $this->assertSame($this->_creditmemo, $childBlock->getEntity()); $this->assertNotEmpty($childBlock->getTitle()); $this->assertEquals($expectedHtml, $actualHtml); }