Exemplo n.º 1
0
 /**
  * @test
  */
 public function shouldAllowCreatePaymentWithStandardActionsAdded()
 {
     $apiMock = $this->createApiMock();
     $payment = PaymentFactory::create($apiMock);
     $this->assertInstanceOf('Payum2\\Payment', $payment);
     $this->assertAttributeCount(1, 'apis', $payment);
     $actions = $this->readAttribute($payment, 'actions');
     $this->assertInternalType('array', $actions);
     $this->assertNotEmpty($actions);
 }
Exemplo n.º 2
0
 protected function getPayment()
 {
     if (false == isset($GLOBALS['__PAYUM_HEARTLAND_APPLICATION_ID'])) {
         $this->markTestSkipped('Please configure __PAYUM_HEARTLAND_APPLICATION_ID in your phpunit.xml');
     }
     if (false == isset($GLOBALS['__PAYUM_HEARTLAND_USERNAME'])) {
         $this->markTestSkipped('Please configure __PAYUM_HEARTLAND_USERNAME in your phpunit.xml');
     }
     if (false == isset($GLOBALS['__PAYUM_HEARTLAND_PASSWORD'])) {
         $this->markTestSkipped('Please configure __PAYUM_HEARTLAND_PASSWORD in your phpunit.xml');
     }
     if (false == isset($GLOBALS['__PAYUM_HEARTLAND_MERCHANT_NAME'])) {
         $this->markTestSkipped('Please configure __PAYUM_HEARTLAND_MERCHANT_NAME in your phpunit.xml');
     }
     $this->api = new Api(array('env' => 'testing', 'application_id' => $GLOBALS['__PAYUM_HEARTLAND_APPLICATION_ID'], 'username' => $GLOBALS['__PAYUM_HEARTLAND_USERNAME'], 'password' => $GLOBALS['__PAYUM_HEARTLAND_PASSWORD']));
     return PaymentFactory::create($this->api);
 }