/** * @expectedException Braintree_Exception_Configuration * @expectedExceptionMessage "invalid" is not a valid environment. */ function testSetInvalidEnvironment() { Braintree_Configuration::environment('invalid'); Braintree_Configuration::reset(); }
* @return boolean */ public function sslOn() { switch ($this->_environment) { case 'integration': case 'development': $ssl = false; break; case 'production': case 'qa': case 'sandbox': default: $ssl = true; break; } return $ssl; } /** * log message to default logger * * @param string $message * */ public function logMessage($message) { error_log('[Braintree] ' . $message); } } Braintree_Configuration::reset();
function setup() { Braintree_Configuration::reset(); }
function testBaseUrl() { Braintree_Configuration::environment('sandbox'); $bu = Braintree_Configuration::baseUrl(); $this->assertEquals('https://sandbox.braintreegateway.com:443', $bu); Braintree_Configuration::reset(); }
/** * @expectedException Braintree_Exception_Configuration * @expectedExceptionMessage Braintree_Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree_Gateway). */ function testParsingWithNoKeysRaisesError() { Braintree_Configuration::reset(); $sampleNotification = Braintree_WebhookTesting::sampleNotification(Braintree_WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, 'my_id'); $webhookNotification = Braintree_WebhookNotification::parse($sampleNotification['bt_signature'], $sampleNotification['bt_payload']); }