Ejemplo n.º 1
0
 public function testPhoneDoesNotExist()
 {
     $phone = new Phone();
     $phone->setCountryCode(1)->setNumber('6127701999')->setType(Phone::PHONE_TYPE_HOME);
     $entity = new Customer();
     $this->assertFalse($entity->getPhoneIndex($phone));
 }
Ejemplo n.º 2
0
 public function testCreateMobile()
 {
     $entity = new Phone();
     $this->assertInstanceOf('Expressly\\Entity\\Phone', $entity->setType(Phone::PHONE_TYPE_MOBILE));
     $this->assertInstanceOf('Expressly\\Entity\\Phone', $entity->setCountryCode(44));
     $this->assertInstanceOf('Expressly\\Entity\\Phone', $entity->setNumber('07951234567'));
     $this->assertEquals(Phone::PHONE_TYPE_MOBILE, $entity->getType());
     $this->assertEquals(44, $entity->getCountryCode());
     $this->assertEquals('07951234567', $entity->getNumber());
     $this->assertJson(json_encode($entity->toArray()));
     $this->assertJsonStringEqualsJsonString(json_encode($entity->toArray()), json_encode(array('type' => 'M', 'countryCode' => 44, 'number' => '07951234567')));
 }