Exemple #1
0
 public function testSections()
 {
     $e = new Entry();
     $this->assertEmpty($e->getSections());
     $s1 = new Section();
     $e->addSection($s1);
     $this->assertCount(1, $e->getSections());
     $this->assertSame($s1, $e->getSections()[0]);
     $s2 = new Section();
     $e->addSection($s2);
     $this->assertCount(2, $e->getSections());
     $this->assertSame($s1, $e->getSections()[0]);
     $this->assertSame($s2, $e->getSections()[1]);
 }
 /**
  * {@inheritdoc}
  */
 public function createEntry(Card $card)
 {
     $entry = new Entry();
     $entry->version = $card->name;
     $entry->date = new \DateTime($card->due);
     foreach ($card->checklists as $checklist) {
         $entry->addSection($this->createSection($checklist));
     }
     return $entry;
 }