/**
  * Testing toString methods and assert no mutation and a valid URL
  */
 public function testToString()
 {
     $url = 'https://www.lonelypullrequests.com/';
     $urlObject = Url::fromString($url);
     $this->assertEquals($urlObject, (string) $urlObject);
     $this->assertEquals($urlObject, $urlObject->toString());
 }
 public function testConvertToDatabaseValue()
 {
     $urlName = 'http://www.example.com/';
     $url = Url::fromString($urlName);
     $databaseValue = $this->type->convertToDatabaseValue($url, $this->platform);
     $this->assertTrue(gettype($databaseValue) === 'string');
     $this->assertSame($databaseValue, $urlName);
 }
 /**
  * @param $array
  *
  * @return Notification
  */
 public static function fromArray($array)
 {
     Ensure::keyExists($array, 'repositoryName');
     Ensure::keyExists($array, 'title');
     Ensure::keyExists($array, 'url');
     Ensure::keyExists($array, 'eventDateTime');
     return new self(RepositoryName::fromString($array['repositoryName']), Title::fromString($array['title']), Url::fromString($array['url']), new DateTimeImmutable($array['eventDateTime']));
 }
 public static function fromArray(array $array)
 {
     Ensure::keyExists($array, 'title');
     Ensure::keyExists($array, 'repositoryName');
     Ensure::keyExists($array, 'url');
     Ensure::keyExists($array, 'loneliness');
     return self::create(Title::fromString($array['title']), RepositoryName::fromString($array['repositoryName']), Url::fromString($array['url']), Loneliness::fromInteger($array['loneliness']));
 }
 /**
  * {@inheritdoc}
  */
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     return Url::fromString($value);
 }