public function testApplyEditing()
 {
     $this->column->expects($this->once())->method('getConfiguration')->willReturn(['dataType' => 'text', 'visible' => true]);
     $this->validationRules->expects($this->once())->method('getValidationRules')->with(true, [$this->validationRule])->willReturn(['validate-email' => true, 'required-entry' => true]);
     $this->column->expects($this->once())->method('setData')->with('config', ['dataType' => 'text', 'visible' => true, 'editor' => ['editorType' => 'text', 'validation' => ['validate-email' => true, 'required-entry' => true]]]);
     $this->component->applyEditing($this->column, 'text', [$this->validationRule], true);
 }
 /**
  * Add editor config
  *
  * @param UiComponentInterface $column
  * @param string $frontendInput
  * @param array $validationRules
  * @param bool|false $isRequired
  * @return UiComponentInterface
  */
 public function applyEditing(UiComponentInterface $column, $frontendInput, array $validationRules, $isRequired = false)
 {
     if (in_array($frontendInput, $this->editableFields)) {
         $config = $column->getConfiguration();
         $editorType = $config['dataType'];
         if (isset($config['editor']) && is_string($config['editor'])) {
             $editorType = $config['editor'];
         }
         if (!(isset($config['editor']) && isset($config['editor']['editorType']))) {
             $config['editor'] = ['editorType' => $editorType];
         }
         $validationRules = $this->validationRules->getValidationRules($isRequired, $validationRules);
         if (!empty($config['editor']['validation'])) {
             $validationRules = array_merge($config['editor']['validation'], $validationRules);
         }
         $config['editor']['validation'] = $validationRules;
         $column->setData('config', $config);
     }
     return $column;
 }
 public function testGetValidationRulesWithOnlyRequiredRule()
 {
     $expectsRules = ['required-entry' => true];
     $this->assertEquals($expectsRules, $this->validationRules->getValidationRules(true, []));
 }