function checkConnection() { $adapter = new DPSAdapter(); $connected = $adapter->postConnect(); if (!$connected) { $this->markTestSkipped("Can't run test without successfully test the connection to dps getway"); } }
function setUp() { parent::setUp(); $runnable = self::get_runnable(); if (!isset($runnable)) { $canrun = true; if (defined('DPSPOST_USERNAME_TEST') && defined('DPSPOST_PASSWORD_TEST') && defined('DPSPAY_USERID_TEST') && defined('DPSPAY_KEY_TEST')) { $canrun &= DPSAdapter::get_pxpost_username() === DPSPOST_USERNAME_TEST; $canrun &= DPSAdapter::get_pxpost_password() === DPSPOST_PASSWORD_TEST; $canrun &= DPSAdapter::get_pxpay_userid() === DPSPAY_USERID_TEST; $canrun &= DPSAdapter::get_pxpay_key() === DPSPAY_KEY_TEST; } else { if (!defined('DPSPOST_USERNAME_TEST')) { $this->markTestSkipped("Can't run test without setting up DPSPOST_USERNAME_TEST the Unit Testing"); } else { if (!defined('DPSPOST_PASSWORD_TEST')) { $this->markTestSkipped("Can't run test without setting up DPSPOST_PASSWORD_TEST the Unit Testing"); } else { if (!defined('DPSPAY_USERID_TEST')) { $this->markTestSkipped("Can't run test without setting up DPSPAY_USERID_TEST the Unit Testing"); } else { if (!defined('DPSPAY_KEY_TEST')) { $this->markTestSkipped("Can't run test without setting up DPSPAY_KEY_TEST the Unit Testing"); } } } } $canrun = false; } if (!$canrun) { self::set_runnable(false); } else { $canrun &= DPSAdapter::postConnect(); if (!$canrun) { self::set_runnable(false); $this->markTestSkipped("Can't run test without successfully test the connection to dps getway"); } else { self::set_runnable(true); } } } }