/**
  * @see http://en.wikipedia.org/wiki/MSISDN#MSISDN_Format
  * @see https://www.messagebird.com/developers#messaging-send
  *
  * @return string
  */
 public function toMSISDN()
 {
     return $this->countryCode->getCountryCode() . $this->phoneNumber->formatAsMsisdnPart();
 }
Esempio n. 2
0
 /**
  * @param PhoneNumber $other
  * @return bool
  */
 public function equals(PhoneNumber $other)
 {
     return $this->formatAsMsisdnPart() === $other->formatAsMsisdnPart();
 }
Esempio n. 3
0
 /**
  * @test
  * @group value
  * @dataProvider formatAsMsisdnPartProvider
  *
  * @param string $given
  * @param string $expectedMsisdnPart
  */
 public function format_as_msisdn_part_strips_exactly_one_leading_zero_if_it_has_one($given, $expectedMsisdnPart)
 {
     $phoneNumber = new PhoneNumber($given);
     $this->assertEquals($expectedMsisdnPart, $phoneNumber->formatAsMsisdnPart());
 }