本文整理汇总了PHP中Thelia\Model\Lang::setDateFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::setDateFormat方法的具体用法?PHP Lang::setDateFormat怎么用?PHP Lang::setDateFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thelia\Model\Lang
的用法示例。
在下文中一共展示了Lang::setDateFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateFacadeStub
/**
* Generate adapter stub
*
* @param int $cartTotalPrice Cart total price
* @param string $checkoutCurrency Checkout currency
* @param string $i18nOutput Output from each translation
*
* @return \PHPUnit_Framework_MockObject_MockObject
*/
public function generateFacadeStub($cartTotalPrice = 400, $checkoutCurrency = 'EUR', $i18nOutput = '')
{
$stubFacade = $this->getMockBuilder('\\Thelia\\Coupon\\BaseFacade')->disableOriginalConstructor()->getMock();
$address = new Address();
$address->setCountryId(10);
$stubFacade->expects($this->any())->method('getDeliveryAddress')->will($this->returnValue($address));
$stubFacade->expects($this->any())->method('getConditionEvaluator')->will($this->returnValue(new ConditionEvaluator()));
$stubTranslator = $this->getMockBuilder('\\Thelia\\Core\\Translation\\Translator')->disableOriginalConstructor()->getMock();
$stubTranslator->expects($this->any())->method('trans')->will($this->returnValue($i18nOutput));
$stubFacade->expects($this->any())->method('getTranslator')->will($this->returnValue($stubTranslator));
$lang = new Lang();
$lang->setDateFormat("d/m/Y");
$stubSession = $this->getMockBuilder('\\Thelia\\Core\\HttpFoundation\\Session\\Session')->disableOriginalConstructor()->getMock();
$stubSession->expects($this->any())->method('getLang')->will($this->returnValue($lang));
$stubRequest = $this->getMockBuilder('\\Thelia\\Core\\HttpFoundation\\Request')->disableOriginalConstructor()->getMock();
$stubRequest->expects($this->any())->method('getSession')->will($this->returnValue($stubSession));
$stubFacade->expects($this->any())->method('getRequest')->will($this->returnValue($stubRequest));
return $stubFacade;
}