| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/www/lrsys_apps/vilagran/vendor/braintree/braintree_php/tests/integration/ |
Upload File : |
<?php
namespace Test\Integration;
require_once dirname(__DIR__) . '/Setup.php';
use Test\Setup;
use Braintree;
class HttpTest extends Setup
{
public function testProductionSSL()
{
try {
Braintree\Configuration::environment('production');
$this->setExpectedException('Braintree\Exception\Authentication');
$http = new Braintree\Http(Braintree\Configuration::$global);
$http->get('/');
} catch (Braintree\Exception $e) {
Braintree\Configuration::environment('development');
throw $e;
}
Braintree\Configuration::environment('development');
}
public function testSandboxSSL()
{
try {
Braintree\Configuration::environment('sandbox');
$this->setExpectedException('Braintree\Exception\Authentication');
$http = new Braintree\Http(Braintree\Configuration::$global);
$http->get('/');
} catch (Braintree\Exception $e) {
Braintree\Configuration::environment('development');
throw $e;
}
Braintree\Configuration::environment('development');
}
public function testSslError()
{
try {
Braintree\Configuration::environment('sandbox');
$this->setExpectedException('Braintree\Exception\SSLCertificate');
$http = new Braintree\Http(Braintree\Configuration::$global);
$http->_doUrlRequest('get', '/malformed_url');
} catch (Braintree\Exception $e) {
Braintree\Configuration::environment('development');
throw $e;
}
Braintree\Configuration::environment('development');
}
public function testAuthorizationWithConfig()
{
$config = new Braintree\Configuration([
'environment' => 'development',
'merchant_id' => 'integration_merchant_id',
'publicKey' => 'badPublicKey',
'privateKey' => 'badPrivateKey'
]);
$http = new Braintree\Http($config);
$result = $http->_doUrlRequest('GET', $config->baseUrl() . '/merchants/integration_merchant_id/customers');
$this->assertEquals(401, $result['status']);
}
}