2 use PayPal\Core\PPConnectionManager;
 
   3 use PayPal\Core\PPHttpConnection;
 
   4 use PayPal\Core\PPHttpConfig;
 
   6  * Test class for PPConnectionManager.
 
   9 class PPConnectionManagerTest extends \PHPUnit_Framework_TestCase
 
  12      * @var PPConnectionManager
 
  16     private $config = array(
 
  17                 'acct1.UserName' => 'jb-us-seller_api1.paypal.com'      ,
 
  18                 'acct1.Password' => 'WX4WTU3S8MY44S7F'  ,
 
  19                 'acct1.Signature' =>    'AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy'      ,
 
  20                 'acct1.AppId' =>        'APP-80W284485P519543T' ,
 
  21                 'acct2.UserName' =>     'certuser_biz_api1.paypal.com'  ,
 
  22                 'acct2.Password' =>     'D6JNKKULHN3G5B8A'      ,
 
  23                 'acct2.CertPath' =>     'cert_key.pem'  ,
 
  24                 'acct2.AppId' =>        'APP-80W284485P519543T' ,
 
  25                 'http.ConnectionTimeOut' =>     '30'    ,
 
  27                 'service.RedirectURL' =>        'https://www.sandbox.paypal.com/webscr&cmd='    ,
 
  28                 'service.DevCentralURL' => 'https://developer.paypal.com'       ,
 
  29                 'service.EndPoint.IPN' => 'https://www.sandbox.paypal.com/cgi-bin/webscr'       ,
 
  30                 'service.EndPoint.AdaptivePayments' => 'https://svcs.sandbox.paypal.com/'       ,
 
  31                 'service.SandboxEmailAddress' => 'platform_sdk_seller@gmail.com',
 
  32                 'log.FileName' => 'PayPal1.log' ,
 
  33                 'log.LogLevel' =>       'INFO'  ,
 
  34                 'log.LogEnabled' =>     '1'     ,
 
  40      * Sets up the fixture, for example, opens a network connection.
 
  41      * This method is called before a test is executed.
 
  43     protected function setUp()
 
  45         $this->object =  PPConnectionManager::getInstance();
 
  49      * Tears down the fixture, for example, closes a network connection.
 
  50      * This method is called after a test is executed.
 
  52     protected function tearDown()
 
  59     public function testGetInstance()
 
  61         $instance = $this->object->getInstance();
 
  62                 $this->assertTrue($instance instanceof PPConnectionManager);
 
  68     public function testGetConnection()
 
  70         $conn = $this->object->getConnection(new PPHttpConfig("http://domain.com"), $this->config);
 
  71         $this->assertNotNull($conn);
 
  72         $this->assertTrue($conn instanceof PPHttpConnection);
 
  73         $this->assertEquals(get_class($conn), "PayPal\Core\PPHttpConnection");