예제 #1
0
 public function testSetTemplateNoProduct()
 {
     $this->_helper->expects($this->once())->method('isStockAlertAllowed')->will($this->returnValue(true));
     $this->_helper->expects($this->never())->method('getSaveUrl');
     $this->_registry->expects($this->any())->method('registry')->with('current_product')->will($this->returnValue(null));
     $this->_block->setLayout($this->_layout);
     $this->_block->setTemplate('path/to/template.phtml');
     $this->assertEquals('', $this->_block->getTemplate());
     $this->assertNull($this->_block->getSignupUrl());
 }
예제 #2
0
 /**
  * @dataProvider testGetFilteredContentDataProvider
  * @param $contentToFilter
  * @param $contentFiltered
  */
 public function testGetFilteredContent($contentToFilter, $contentFiltered)
 {
     $this->_filter->expects($this->once())->method('filter')->with($contentToFilter)->will($this->returnValue($contentFiltered));
     $this->assertEquals($contentFiltered, $this->_block->getFilteredContent($contentToFilter));
 }