예제 #1
0
 /**
  * @covers Kunstmaan\MediaBundle\Entity\Folder::hasActive
  */
 public function testHasActive()
 {
     $root = new Folder();
     $root->setId(1);
     $subFolder = new Folder();
     $subFolder->setId(2);
     $root->addChild($subFolder);
     $subFolder2 = new Folder();
     $subFolder2->setId(4);
     $root->addChild($subFolder2);
     $subSubFolder = new Folder();
     $subSubFolder->setId(3);
     $subFolder->addChild($subSubFolder);
     $this->assertTrue($root->hasActive(2));
     $this->assertTrue($root->hasActive(4));
     $this->assertTrue($subFolder->hasActive(3));
     $this->assertFalse($subFolder->hasActive(4));
 }