public function testFindDoableExports()
 {
     $notDoable1 = new FtpExport();
     $notDoable1->setAddr('Not Doable 1')->setUser(self::$DI['user']);
     $elem1 = new FtpExportElement();
     $elem1->setSubdef('subdef')->setFilename('name')->setBaseId(self::$DI['record_1']->get_base_id())->setRecordId(self::$DI['record_1']->get_record_id())->setDone(true);
     $elem1->setExport($notDoable1);
     $notDoable1->addElement($elem1);
     $notDoable2 = new FtpExport();
     $notDoable2->setAddr('Not Doable 2')->setUser(self::$DI['user']);
     $doable1 = new FtpExport();
     $doable1->setAddr('Doable 1')->setUser(self::$DI['user']);
     $elem2 = new FtpExportElement();
     $elem2->setSubdef('subdef')->setFilename('name')->setBaseId(self::$DI['record_1']->get_base_id())->setRecordId(self::$DI['record_1']->get_record_id())->setDone(true);
     $elem2->setExport($doable1);
     $doable1->addElement($elem2);
     $elem3 = new FtpExportElement();
     $elem3->setSubdef('subdef')->setFilename('name')->setBaseId(self::$DI['record_2']->get_base_id())->setRecordId(self::$DI['record_2']->get_record_id())->setDone(false);
     $elem3->setExport($doable1);
     $doable1->addElement($elem3);
     $doable2 = new FtpExport();
     $doable2->setAddr('Doable 2')->setUser(self::$DI['user']);
     $elem4 = new FtpExportElement();
     $elem4->setSubdef('subdef')->setFilename('name')->setBaseId(self::$DI['record_1']->get_base_id())->setRecordId(self::$DI['record_1']->get_record_id())->setDone(false);
     $elem4->setExport($doable2);
     $doable2->addElement($elem4);
     self::$DI['app']['orm.em']->persist($notDoable1);
     self::$DI['app']['orm.em']->persist($notDoable2);
     self::$DI['app']['orm.em']->persist($doable1);
     self::$DI['app']['orm.em']->persist($doable2);
     self::$DI['app']['orm.em']->flush();
     $doables = self::$DI['app']['orm.em']->getRepository('Phraseanet:FtpExport')->findDoableExports();
     $this->assertCount(2, $doables);
     $this->assertContains($doable1, $doables);
     $this->assertContains($doable2, $doables);
 }
 /**
  * {@inheritDoc}
  */
 public function setSubdef($subdef)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSubdef', array($subdef));
     return parent::setSubdef($subdef);
 }