public function testRender() { $rule = $this->getMockBuilder('Magento\\Rule\\Model\\AbstractModel')->setMethods(['getConditions', '__sleep', '__wakeup'])->disableOriginalConstructor()->getMockForAbstractClass(); $conditions = $this->getMock('\\Magento\\Rule\\Model\\Condition\\Combine', ['asHtmlRecursive'], [], '', false); $this->_element->expects($this->any())->method('getRule')->will($this->returnValue($rule)); $rule->expects($this->any())->method('getConditions')->will($this->returnValue($conditions)); $conditions->expects($this->once())->method('asHtmlRecursive')->will($this->returnValue('conditions html')); $this->assertEquals('conditions html', $this->conditions->render($this->_element)); }
public function testRender() { $rule = $this->getMock('\\Magento\\Rule\\Model\\Rule', ['getConditions', '__sleep', '__wakeup'], [], '', false); $conditions = $this->getMock('\\Magento\\Rule\\Model\\Condition\\Combine', ['asHtmlRecursive'], [], '', false); $this->_element->expects($this->any())->method('getRule')->will($this->returnValue($rule)); $rule->expects($this->any())->method('getConditions')->will($this->returnValue($conditions)); $conditions->expects($this->once())->method('asHtmlRecursive')->will($this->returnValue('conditions html')); $this->assertEquals('conditions html', $this->conditions->render($this->_element)); }