public function testSendOrderByEmailWhenMailingFails() { oxEmailHelper::$blRetValue = false; oxAddClassModule('oxEmailHelper', 'oxemail'); $oOrder = $this->getProxyClass("oxOrder"); $iRes = $oOrder->UNITsendOrderByEmail(null, null, null); $this->assertEquals(0, $iRes); }
public function testSetNewsSubscriptionUnsubscribes() { oxEmailHelper::$blRetValue = true; oxAddClassModule('oxEmailHelper', 'oxemail'); $oConfig = $this->getMock('oxconfig'); $oSubscription = $this->getMock('oxnewssubscribed', array('getOptInStatus', 'setOptInStatus')); $oSubscription->expects($this->never())->method('getOptInStatus'); $oSubscription->expects($this->once())->method('setOptInStatus')->with($this->equalTo(0)); $oUser = $this->getMock('oxuser', array('getNewsSubscription', 'addToGroup', 'removeFromGroup')); $oUser->expects($this->once())->method('getNewsSubscription')->will($this->returnValue($oSubscription)); $oUser->expects($this->never())->method('addToGroup'); $oUser->expects($this->once())->method('removeFromGroup')->with($this->equalTo('oxidnewsletter')); $oUser->setConfig($oConfig); $this->assertTrue($oUser->setNewsSubscription(false, false)); }