public function testToHtml() { $this->assertEmpty($this->_block->getProductCollection()); $this->_block->setProductsCount(5); $this->_block->setTemplate('product/widget/new/content/new_list.phtml'); $this->_block->setLayout(new Mage_Core_Model_Layout()); $html = $this->_block->toHtml(); $this->assertNotEmpty($html); $this->assertContains('New Product', $html); $this->assertInstanceOf('Mage_Catalog_Model_Resource_Product_Collection', $this->_block->getProductCollection()); }