Example #1
0
 */
/**
 * Test api credentials provided by PayU
 * @link http://docs.payulatam.com/pt-br/integracao-com-api/o-que-voce-precisa-saber-a-integracao-via-api/
 */
//define('PAYU_ACCOUNT_ID', '500719');                  //Brazil
//define('PAYU_MERCHANT_ID', '500365');                 //Brazil
//define('PAYU_API_LOGIN', '403ba744e9827f3');          //Brazil
//define('PAYU_API_KEY', '676k86ks53la6tni6clgd30jf6'); //Brazil
define('PAYU_ACCOUNT_ID', '500537');
//Panama
define('PAYU_MERCHANT_ID', '500238');
//Panama
define('PAYU_API_LOGIN', '11959c415b33d0c');
//Panama
define('PAYU_API_KEY', '6u39nqhq8ftd0hlvnjfs66eh8c');
//Panama
// Session start.
session_start();
// Path for api.
define('LIBRARY_PATH', dirname(__FILE__) . '/../src');
// Path for test stuff.
define('STUFF_PATH', dirname(__FILE__) . '/PayU/.stuff');
// Defining PHP include path.
set_include_path(implode(PATH_SEPARATOR, array(LIBRARY_PATH, get_include_path())));
// Composer autoload.
require_once LIBRARY_PATH . '/../vendor/autoload.php';
//Ativando componente de log.
$logfile = LIBRARY_PATH . '/../logs/payu_' . date('Y-m-d') . '.log';
\Tbs\Log::getInstance()->setLogger(new \Tbs\Log\File($logfile));
Example #2
0
 /**
  * @see \Tbs\Log:__callStatic()
  * @dataProvider providerLogMessages
  * @expectedException \Tbs\Log\Exception
  */
 public function test__callStaticLevelException($message, $level)
 {
     log::getInstance()->resetInstance();
     log::$level($message);
 }
Example #3
0
 /**
  * @see \Tbs\ZfComponents\V1\Bootstrap::initLog()
  */
 public function testInitLog()
 {
     $expected = APPLICATION_LOGS . '/' . APPLICATION_LOG_PREFIX . '_' . date('Y-m-d') . '.log';
     $logfile = \Tbs\Log::getInstance()->getLogger()->getLogFile();
     $this->assertEquals($expected, $logfile);
 }
Example #4
0
 /**
  * Initing the log classes.
  */
 public static function initLog()
 {
     try {
         if (!is_dir(self::$applicationLogs) or !is_writable(self::$applicationLogs)) {
             $message = sprintf('The log directory "%s" not exists or is not writable', self::$applicationLogs);
             throw new \Tbs\ZfComponents\V1\Bootstrap\Exception($message);
         }
         $logfile = sprintf('%s/%s_%s.log', self::$applicationLogs, self::$applicationLogPrefix, date('Y-m-d'));
         \Tbs\Log::getInstance()->setLogger(new \Tbs\Log\File($logfile));
     } catch (\Exception $e) {
         die($e->getMessage());
     }
 }