Esempio n. 1
0
 public function testCreate()
 {
     $importResult = new ImportResult();
     $importResult->incrementSuccess();
     $importResult->addFailedRow(['test']);
     $importResult->addErrorMessage('error message');
     $this->assertSame(1, $importResult->getSuccessCount());
     $this->assertSame(1, $importResult->getFailedCount());
     $this->assertSame([['test']], $importResult->getFailedRows());
     $this->assertSame(['error message'], $importResult->getErrorMessages());
 }
 public function ImportUploadedCourse($courseId, $path, $permissionDomain = null)
 {
     $request = new ServiceRequest($this->_configuration);
     $params = array('courseid' => $courseId, 'path' => $path);
     $request->setMethodParams($params);
     $response = $request->CallService("rustici.course.importCourse");
     write_log('rustici.course.importCourse : ' . $response);
     $importResult = new ImportResult(null);
     return $importResult->ConvertToImportResults($response);
 }
 public function ImportUploadedCourse($courseId, $path, $permissionDomain = null)
 {
     $request = new ServiceRequest($this->_configuration);
     $params = array('courseid' => $courseId, 'path' => $path);
     // if (!is_null($itemIdToImport))
     //{
     //			$params[] = 'itemid' => $itemIdToImport;
     //}
     //if (!String.IsNullOrEmpty(permissionDomain))
     //    request.Parameters.Add("pd", permissionDomain);
     $request->setMethodParams($params);
     $response = $request->CallService("rustici.course.importCourse");
     write_log('rustici.course.importCourse : ' . $response);
     $importResult = new ImportResult(null);
     return $importResult->ConvertToImportResults($response);
 }