示例#1
0
 public function setUp()
 {
     $timezone = new DateTimeZone(date_default_timezone_get());
     $coreExtension = $this->getMock('Twig_Extension_Core');
     $coreExtension->expects($this->any())->method('getTimezone')->will($this->returnValue($timezone));
     $this->env = $this->getMockBuilder('Twig_Environment')->disableOriginalConstructor()->getMock();
     $this->env->expects($this->any())->method('getExtension')->with('core')->will($this->returnValue($coreExtension));
 }
示例#2
0
 public function setUp()
 {
     $this->env = $this->getMock('Twig_Environment');
     $this->env->expects($this->any())->method('getCharset')->will($this->returnValue('utf-8'));
 }
示例#3
0
 public function setUp()
 {
     $this->env = $this->getMockBuilder('Twig_Environment')->disableOriginalConstructor()->getMock();
     $this->env->expects($this->any())->method('getCharset')->will($this->returnValue('utf-8'));
 }