Exemplo n.º 1
0
 /**
  * @test
  */
 public function initialize()
 {
     parent::initialize();
     $author = [];
     foreach (['kirk', 'spock', 'mccoy'] as $nick) {
         $author[] = new Author($nick);
     }
     $doc0 = new SmallTalk($author[0]);
     $doc1 = clone $doc0;
     $doc0->report($author[1]);
     $doc2 = clone $doc0;
     $comm = new Commentary($author[1]);
     $comm->report($author[2]);
     $doc1->attachCommentary($comm);
     $doc3 = clone $doc1;
     $this->getService('dokudoki.repository')->batchPersist([$doc0, $doc1, $doc2, $doc3]);
 }
Exemplo n.º 2
0
 protected function initDbWithOnePublishingWithReportedComment()
 {
     $author = [];
     foreach (['kirk', 'spock', 'mccoy'] as $nick) {
         $author[] = new Author($nick);
     }
     $doc = new SmallTalk($author[0]);
     $comm = new Commentary($author[1]);
     $comm->report($author[2]);
     $comm->report($author[0]);
     $doc->attachCommentary($comm);
     $this->coll->drop();
     $this->repo->persist($doc);
 }