999c4644f50000347e07a940104e65c26bb8a3db
[WP-Plugins/glm-member-db-registrations.git] /
1 <?php
2 use PayPal\Core\PPConnectionManager;
3 use PayPal\Core\PPHttpConnection;
4 use PayPal\Core\PPHttpConfig;
5 /**
6  * Test class for PPConnectionManager.
7  *
8  */
9 class PPConnectionManagerTest extends \PHPUnit_Framework_TestCase
10 {
11     /**
12      * @var PPConnectionManager
13      */
14     protected $object;
15     
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'    ,
26                 'http.Retry' =>         '5'     ,
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'     ,
35     
36     
37     );
38
39     /**
40      * Sets up the fixture, for example, opens a network connection.
41      * This method is called before a test is executed.
42      */
43     protected function setUp()
44     {
45         $this->object =  PPConnectionManager::getInstance();
46     }
47
48     /**
49      * Tears down the fixture, for example, closes a network connection.
50      * This method is called after a test is executed.
51      */
52     protected function tearDown()
53     {
54     }
55
56     /**
57      * @test
58      */
59     public function testGetInstance()
60     {
61         $instance = $this->object->getInstance();
62                 $this->assertTrue($instance instanceof PPConnectionManager);
63     }
64
65     /**
66      * @test
67      */
68     public function testGetConnection()
69     {
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");
74     }
75 }
76 ?>