Пример #1
0
 public function testClearMessageWithDefaultValue()
 {
     $phone = new PhoneNumber();
     $this->assertNull($phone->getNumber());
     $this->assertSame(PhoneType::HOME(), $phone->getType());
     $phone->setNumber('1231231212');
     $phone->setType(PhoneType::MOBILE());
     $this->assertEquals('1231231212', $phone->getNumber());
     $this->assertSame(PhoneType::MOBILE(), $phone->getType());
     $phone->clear();
     $this->assertNull($phone->getNumber());
     $this->assertSame(PhoneType::HOME(), $phone->getType());
 }
 public function testComplexMessageFromArrayDefaults()
 {
     $phone = PhoneNumber::fromArray(['number' => '1231231212']);
     $this->assertEquals($phone->getNumber(), '1231231212');
     $this->assertEquals($phone->getType(), PhoneType::HOME());
 }