public function testGettersSetters() { $customerInfo = new CustomerInfo(); $payment = new Payment(); $payment->setValue(1.23); $payment->setKey('secret'); $payment->setMaxDate('2014-11-29'); $payment->setCustomerInfo($customerInfo); $this->assertSame(1.23, $payment->getValue()); $this->assertSame('secret', $payment->getKey()); $this->assertSame('2014-11-29', $payment->getMaxDate()); $this->assertSame($customerInfo, $payment->getCustomerInfo()); }
public function testMotoPayment() { $payment = new Payment(); $payment->setType(Payment::TYPE_MOTO); $payment->setValue(10); $payment->setKey('key'); $request = new CreatePayment($payment); $params = $request->handleRequest($this->getConfig()); $this->assertTrue(is_array($params)); $this->assertCount(9, $params); $this->assertSame('cin', $params['ep_cin']); $this->assertSame('user', $params['ep_user']); $this->assertSame('entity', $params['ep_entity']); $this->assertSame('language', $params['ep_language']); $this->assertSame('country', $params['ep_country']); $this->assertSame('auto', $params['ep_ref_type']); $this->assertSame('moto', $params['ep_type']); $this->assertSame('10', $params['t_value']); $this->assertSame('key', $params['t_key']); }
/** * @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()); }