Example #1
0
 /**
  * @Given /^I create (\d+) random Article entries$/
  */
 public function iCreateRandomArticleEntries($nbr)
 {
     $container = $this->getContainer();
     $em = $container->get('doctrine.orm.default_entity_manager');
     for ($i = 0; $i < $nbr; $i++) {
         $entity = new Article();
         $entity->setTitle('title' . $i);
         $entity->setContent('content' . $i);
         $em->persist($entity);
     }
     $em->flush();
 }
Example #2
0
 protected function loadArticle()
 {
     for ($i = 1; $i <= self::ARTICLE_NBR; $i++) {
         $entity = new Article();
         $entity->setTitle('title_' . $i);
         $entity->setContent('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
         cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
         proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
         $this->manager->persist($entity);
     }
     $this->manager->flush();
 }