/** Set up tests. */
 public function setUp()
 {
     $this->setupDatabase(array('default'));
     $this->_daos = array('User');
     $this->_models = array('User');
     $this->enabledModules = array('batchmake');
     parent::setUp();
 }
 /** set up tests */
 public function setUp()
 {
     $this->setupDatabase(array('default'));
     $this->_models = array('User');
     $this->enabledModules = array('batchmake');
     $this->cwd = getcwd();
     parent::setUp();
     if (!isset($this->kwBatchmakeComponent)) {
         require_once BASE_PATH . '/modules/batchmake/controllers/components/KWBatchmakeComponent.php';
         require_once BASE_PATH . '/modules/batchmake/tests/library/ExecutorMock.php';
         $executor = new Batchmake_ExecutorMock();
         $this->kwBatchmakeComponent = new Batchmake_KWBatchmakeComponent($this->setupAndGetConfig(), $executor);
     }
 }
 /** set up tests */
 public function setUp()
 {
     $this->setupDatabase(array('default'));
     $this->_models = array('User', 'Item', 'Bitstream');
     $this->_components = array('Export', 'Upload');
     $this->enabledModules = array('batchmake', 'api');
     $this->cwd = getcwd();
     parent::setUp();
     if (!isset($this->executeComponent)) {
         require_once BASE_PATH . '/modules/batchmake/controllers/components/ExecuteComponent.php';
         $this->executeComponent = new Batchmake_ExecuteComponent();
     }
     if (!isset($this->kwBatchmakeComponent)) {
         require_once BASE_PATH . '/modules/batchmake/controllers/components/KWBatchmakeComponent.php';
         require_once BASE_PATH . '/modules/batchmake/tests/library/ExecutorMock.php';
         $executor = new Batchmake_ExecutorMock();
         $this->kwBatchmakeComponent = new Batchmake_KWBatchmakeComponent($this->setupAndGetConfig(), $executor);
     }
     // upload a file for testing of the exports
     $tmpDir = $this->getTempDirectory() . '/' . $this->testTmpDir;
     // use UploadComponent
     require_once BASE_PATH . '/core/controllers/components/UploadComponent.php';
     $uploadComponent = new UploadComponent();
     // notifier is required in ItemRevisionModelBase::addBitstream, create a fake one
     Zend_Registry::set('notifier', new MIDAS_Notifier(false, null));
     // create a directory for testing the export component
     if (file_exists($tmpDir)) {
         if (!KWUtils::recursiveRemoveDirectory($tmpDir)) {
             throw new Zend_Exception($tmpDir . ' already exists and cannot be deleted.');
         }
     }
     if (!mkdir($tmpDir)) {
         throw new Zend_Exception('Cannot create directory: ' . $tmpDir);
     }
     chmod($tmpDir, 0777);
     // upload an item to user1's public folder
     $user1_public_path = $tmpDir . '/public.file';
     copy(BASE_PATH . '/tests/testfiles/search.png', $user1_public_path);
     $user1_public_fh = fopen($user1_public_path, 'a+');
     fwrite($user1_public_fh, 'content:user1_public');
     fclose($user1_public_fh);
     $user1_public_filename = 'public.file';
     $usersFile = $this->loadData('User', 'default');
     $userDao = $this->User->load($usersFile[0]->getKey());
     $user1_public_parent = '1001';
     $license = 0;
     $this->tmpItem = $uploadComponent->createUploadedItem($userDao, $user1_public_filename, $user1_public_path, $user1_public_parent, $license, '', true);
     parent::setUp();
 }