コード例 #1
0
ファイル: PaymentTest.php プロジェクト: gordalina/easypay-php
 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());
 }
コード例 #2
0
 public function testCustomerInfo()
 {
     $customerInfo = new CustomerInfo();
     $customerInfo->setName('John Doe')->setDescription('Payment #1')->setObservation('test')->setMobile('800600600')->setEmail('*****@*****.**');
     $payment = new Payment();
     $payment->setValue(10);
     $payment->setKey('key');
     $payment->setCustomerInfo($customerInfo);
     $request = new CreatePayment($payment);
     $params = $request->handleRequest($this->getConfig());
     $this->assertTrue(is_array($params));
     $this->assertCount(13, $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('10', $params['t_value']);
     $this->assertSame('key', $params['t_key']);
     $this->assertSame('John Doe', $params['o_name']);
     $this->assertSame('Payment #1', $params['o_description']);
     $this->assertSame('test', $params['o_obs']);
     $this->assertSame('800600600', $params['o_mobile']);
     $this->assertSame('*****@*****.**', $params['o_email']);
 }