/** * @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()); }
public function getRequest() { $payment = new Payment(); $payment->setValue(10); return new CreatePayment($payment); }
public function testValidity() { $payment = new Payment(); $payment->setValue(10); $this->assertTrue($payment->isValid()); }