예제 #1
0
 /**
  * @see CreditCardEntity::isEmpty()
  */
 public function testIsEmptyFalse()
 {
     $this->object->setName('what-ever');
     $rs = $this->object->isEmpty();
     $this->assertFalse($rs);
 }
예제 #2
0
 /**
  * @see TransactionEntity::setCreditCard()
  */
 public function testSetCreditCard()
 {
     $creditCardEntity = new CreditCardEntity();
     $number = str_repeat(rand(1, 9), 4) . str_repeat(rand(1, 9), 4) . str_repeat(rand(1, 9), 4) . str_repeat(rand(1, 9), 4);
     $creditCardEntity->setNumber($number);
     $securityCode = rand(1, 9) . rand(1, 9) . rand(1, 9);
     $creditCardEntity->setSecurityCode($securityCode);
     $expirationDate = rand(1, 9) . rand(1, 9) . rand(1, 9) . rand(1, 9) . '/' . rand(1, 9) . rand(1, 9);
     $creditCardEntity->setExpirationDate($expirationDate);
     $name = 'person name ' . rand(1, 9) . rand(1, 9) . rand(1, 9);
     $creditCardEntity->setName($name);
     $rs = $this->object->setCreditCard($creditCardEntity);
     $this->assertInstanceOf('\\PayU\\Entity\\Transaction\\TransactionEntity', $rs);
     $rs = $this->object->getCreditCard();
     $this->assertInstanceOf('PayU\\Entity\\Transaction\\CreditCardEntity', $rs);
     $this->assertEquals($number, $rs->getNumber());
     $this->assertEquals($securityCode, $rs->getSecurityCode());
     $this->assertEquals($expirationDate, $rs->getExpirationDate());
     $this->assertEquals($name, $rs->getName());
 }