public function testUserIsFetchedFromDatabaseAndUpdated()
{
$this->clearDb();
$user = new GithubUser('ikwattro');
$user->setDescription('neo4j consultant');
$this->em->persist($user);
$this->em->flush();
$this->assertGraphExist('(u:User {login:"ikwattro", description:"neo4j consultant"})');
$this->em->clear();
/** @var GithubUser $ikwattro */
$ikwattro = $this->em->getRepository(GithubUser::class)->findOneBy('login', 'ikwattro');
$this->assertEquals('ikwattro', $ikwattro->getLogin());
$this->assertEquals('neo4j consultant', $ikwattro->getDescription());
$this->assertTrue($ikwattro->getOwnedRepositories() instanceof LazyRelationshipCollection);
$ikwattro->setDescription('neo4j developer');
$this->em->flush();
$this->assertGraphExist('(u:User {login:"ikwattro", description:"neo4j developer"})');
}