Example #1
0
 /**
  * @see PayerEntity::setEmailAddress()
  */
 public function testSetEmailAddressInvalid()
 {
     try {
         $this->object->setEmailAddress('email-address');
     } catch (\Exception $e) {
         $this->assertInstanceOf('\\PayU\\Entity\\EntityException', $e);
         $this->assertEquals('Invalid e-mail address: email-address', $e->getMessage());
         $this->assertEquals(0, $e->getCode());
     }
 }
 /**
  * @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());
 }