public function test_it_creates_and_returns_new_original_url_entity()
 {
     $encodedUrl = "http%3A%2F%2Fsome-domain%2Fsome-resource-address";
     $result = $this->factory->create($encodedUrl);
     $this->assertInstanceOf('AppBundle\\Entity\\OriginalUrl', $result);
     $this->assertEquals($encodedUrl, $result->getEncodedLink());
     $this->assertNotEmpty($result->getDateCreated());
 }
 /**
  * @param string $encodedLink
  * @return OriginalUrl|null
  */
 private function getOriginalUrlEntity($encodedLink)
 {
     $entity = $this->originalUrlRepo->findByEncodedLink($encodedLink);
     if (null === $entity) {
         $entity = $this->originalUrlFactory->create($encodedLink);
         $this->entityManager->persist($entity);
     }
     return $entity;
 }