- /** @var Annotation $annotation */
- $annotation = $this->client->getContainer()
- ->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagAnnotationBundle:Annotation')
- ->findOneByUsername('admin');
+ $em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
+
+ $user = $em
+ ->getRepository('WallabagUserBundle:User')
+ ->findOneByUserName('admin');
+ $entry = $em
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findOneByUsernameAndNotArchived('admin');
+
+ $annotation = new Annotation($user);
+ $annotation->setEntry($entry);
+ $annotation->setText('This is my annotation /o/');
+ $annotation->setQuote('content');