public function testCsvUploadBulkOk() { $fileNames = array('/csv/SimUploadBulk.csv', '/csv/SimUploadBulk2.csv', '/csv/SimUploadBulk3.csv'); foreach ($fileNames as $fileName) { $result = $this->_service->uploadBulk(__DIR__ . $fileName); $this->assertNotNull($result); $this->assertInstanceOf('\\Core\\Model\\WatcherModel', $result); } }
public function uploadAction() { // Check permissions according to the data type $dumbSim = new Application\Model\SimModel(); $this->_helper->allowed('import', $dumbSim); // Import file $upload = $this->_helper->uploadFile(array('csv')); // ExtJS requires the response to be { success: true } $this->view->success = true; $watcher = $this->_simSrv->uploadBulk($upload->getFileName()); $this->_helper->filterNotAllowedFields('read_field', $watcher); // Execute bulk upload $this->view->watcher = $watcher; }