Ejemplo n.º 1
0
 /**
  * @covers Kunstmaan\MediaBundle\Entity\Folder::getChildren
  * @covers Kunstmaan\MediaBundle\Entity\Folder::setChildren
  */
 public function testGetSetChildren()
 {
     $child = new Folder();
     $deletedChild = new Folder();
     $deletedChild->setDeleted(true);
     $children = new ArrayCollection();
     $children->add($child);
     $children->add($deletedChild);
     $this->object->setChildren($children);
     $this->assertCount(1, $this->object->getChildren());
     $this->assertCount(1, $this->object->getChildren(false));
     $this->assertCount(2, $this->object->getChildren(true));
     $children = $this->object->getChildren(false);
     $this->assertContains($child, $children);
     $this->assertNotContains($deletedChild, $children);
     $children = $this->object->getChildren(true);
     $this->assertContains($child, $children);
     $this->assertContains($deletedChild, $children);
 }