function it_removes_existing_url_when_uid_and_delete_token_matches(UrlRepository $repository, Url $url) { $url->getUid()->willReturn('uid'); $url->getDeleteToken()->willReturn('delete_token'); $request = new DeleteUrlRequest('uid', 'delete_token'); $repository->findByUid('uid')->shouldBeCalled()->willReturn($url); $repository->remove($url)->shouldBeCalled(); $this->beConstructedWith($repository); $this->execute($request)->shouldReturn(true); }
private function createEntityFromModel(Url $url) { return new EntityUrl($url->getUrl(), $url->getUid(), $url->getDeleteToken()); }