Ejemplo n.º 1
0
 /**
  * @group integration
  */
 public function testCreatePaymentWithKey()
 {
     $payment = new Payment();
     $payment->setValue(12);
     $payment->setKey('secret');
     $request = new CreatePayment($payment);
     $response = $this->getClient()->request($request);
     $this->assertTrue($response->isValid());
     $this->assertSame('ok0', $response->getStatus());
     $this->assertStringStartsWith('ep_country and ep_entity and ep_user and ep_cin ok', $response->getMessage());
     $this->assertSame($this->getConfig()->getCin(), $response->getCin());
     $this->assertSame($this->getConfig()->getUser(), $response->getUser());
     $this->assertSame($this->getConfig()->getEntity(), $response->getEntity());
     $this->assertTrue($response->getReference() != null);
     $this->assertSame($payment->getValue(), $response->getValue());
     $this->assertSame($payment->getKey(), $response->getKey());
     $this->assertRegExp('#https?://(test\\.|www\\.)?easypay.pt/_s/.*#', $response->getLink());
     $this->assertSame($payment->getKey(), $response->getKey());
 }
Ejemplo n.º 2
0
 public function getRequest()
 {
     $payment = new Payment();
     $payment->setValue(10);
     return new CreatePayment($payment);
 }
Ejemplo n.º 3
0
 public function testValidity()
 {
     $payment = new Payment();
     $payment->setValue(10);
     $this->assertTrue($payment->isValid());
 }