Exemple #1
0
 /**
  * Test the method EbayEnterprise_MageLog_Helper_Data::log when invoked
  * will call the EbayEnterprise_MageLog_Model_Logger::log passing the proper
  * parameters.
  * @param int $level
  * @param string $message
  * @param array $context
  * @dataProvider providerLog
  */
 public function testLog($level, $message, array $context)
 {
     $file = '';
     $forceLog = false;
     $context = $this->_helper->getContext()->getMetaData(__CLASS__, $context);
     $logger = $this->getModelMock('ebayenterprise_magelog/logger', ['log']);
     $logger->expects($this->once())->method('log')->with($this->identicalTo($message), $this->identicalTo(Zend_Log::EMERG), $this->identicalTo($file), $this->identicalTo($forceLog), $this->identicalTo($context))->will($this->returnSelf());
     $this->replaceByMock('model', 'ebayenterprise_magelog/logger', $logger);
     EcomDev_Utils_Reflection::setRestrictedPropertyValue($this->_helper, '_logger', null);
     $this->assertSame($this->_helper, $this->_helper->log($level, $message, $context));
 }