Esempio n. 1
0
 /**
  * @see PayerEntity::toArray()
  */
 public function testToArray()
 {
     $entity = array('fullName' => 'person name ' . rand(1, 9) . rand(1, 9) . rand(1, 9), 'emailAddress' => 'email' . rand(1, 9) . rand(1, 9) . rand(1, 9) . '@foo-bar.com', 'contactPhone' => rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9), 'billingAddress' => new BillingAddressEntity());
     $this->object->setFullName($entity['fullName'])->setEmailAddress($entity['emailAddress'])->setContactPhone($entity['contactPhone'])->setBillingAddress($entity['billingAddress']);
     $this->assertEquals($entity['fullName'], $this->object->getFullName());
     $this->assertEquals($entity['emailAddress'], $this->object->getEmailAddress());
     $this->assertEquals($entity['contactPhone'], $this->object->getContactPhone());
     $this->assertEquals($entity['billingAddress'], $this->object->getBillingAddress());
 }
 /**
  * @see TransactionEntity::setPayer()
  */
 public function testSetPayer()
 {
     $payerEntity = new PayerEntity();
     $fullName = 'person name ' . rand(1, 9) . rand(1, 9) . rand(1, 9);
     $payerEntity->setFullName($fullName);
     $emailAddress = 'email' . rand(1, 9) . rand(1, 9) . rand(1, 9) . '@foo-bar.com';
     $payerEntity->setEmailAddress($emailAddress);
     $rs = $this->object->setPayer($payerEntity);
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\TransactionEntity', $rs);
     $rs = $this->object->getPayer();
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\PayerEntity', $rs);
     $this->assertEquals($fullName, $rs->getFullName());
     $this->assertEquals($emailAddress, $rs->getEmailAddress());
 }