import() публичный Метод

Attempt to import user settings.
public import ( array $user_settings, boolean $force = true ) : Result
$user_settings array
$force boolean If set to true user settings not included in the import will be deleted
Результат Result
Пример #1
0
 /**
  * Test users service import.
  *
  * @covers ::import
  */
 public function testUsersServiceImportWithImportError()
 {
     $mockFieldsService = $this->getMockFieldServiceForImport(false);
     $mockSchematicFieldsService = $this->getMockSchematicFieldServiceForImport(true);
     $this->setComponent(Craft::app(), 'fields', $mockFieldsService);
     $this->setComponent(Craft::app(), 'schematic_fields', $mockSchematicFieldsService);
     $import = $this->schematicUsersService->import([]);
     $this->assertTrue($import instanceof Result);
     $this->assertTrue($import->hasErrors('errors'));
 }