/**
  * Ensures everything works as expected.
  */
 public function testPersistCreate()
 {
     $repository = $this->_entityManager->getRepository('\\Conjoon\\Data\\Entity\\Mail\\DefaultMailFolderEntity');
     $this->assertTrue($repository instanceof \Conjoon\Data\Repository\Mail\DoctrineMailFolderRepository);
     $this->assertEquals($this->mailFolderCount, $this->getConnection()->getRowCount('groupware_email_folders'), "Pre-Condition");
     $entity = new \Conjoon\Data\Entity\Mail\DefaultMailFolderEntity();
     $entity->setName("newname");
     $entity->setType("inbox");
     $entity->setMetaInfo("inbox");
     $entity->setIsChildAllowed(1);
     $entity->setIsLocked(0);
     $entity->setIsDeleted(0);
     // PERSIST
     $repository->register($entity);
     $this->assertEquals($this->mailFolderCount, $this->getConnection()->getRowCount('groupware_email_folders'), "Pre-Condition");
     $queryTable = $this->getConnection()->createQueryTable('groupware_email_folders', 'SELECT * FROM groupware_email_folders');
     $expectedTable = $this->createXmlDataSet(dirname(__FILE__) . '/fixtures/mysql/mail_folder.xml')->getTable("groupware_email_folders");
     $this->assertTablesEqual($expectedTable, $queryTable);
     // FLUSH
     $repository->flush();
     $this->assertEquals($this->mailFolderCount + 1, $this->getConnection()->getRowCount('groupware_email_folders'), "Post-Condition");
     $queryTable = $this->getConnection()->createQueryTable('groupware_email_folders', 'SELECT * FROM groupware_email_folders');
     $expectedTable = $this->createXmlDataSet(dirname(__FILE__) . '/fixtures/mysql/mail_folder.add.result.xml')->getTable("groupware_email_folders");
     $this->assertTablesEqual($expectedTable, $queryTable);
 }
 /**
  * Ensure everything works as expected
  */
 public function test_CN943_EntityAsArgument()
 {
     $folder = new \Conjoon\Data\Entity\Mail\DefaultMailFolderEntity();
     $folder->setIsChildAllowed(true);
     $this->commons->getChildFolderEntities($folder);
 }