multiple example


        catch (MigrateSkipProcessException $e) {
          $value = NULL;
          break;
        }
        catch (MigrateException $e) {
          // Prepend the process plugin id to the message.           $message = sprintf("%s: %s", $plugin->getPluginId()$e->getMessage());
          throw new MigrateException($message);
        }

        $multiple = $plugin->multiple();
      }
    }
    // Ensure all values, including nulls, are migrated.     if ($plugins) {
      if (isset($value)) {
        $row->setDestinationProperty($destination$value);
      }
      else {
        $row->setEmptyDestinationProperty($destination);
      }
    }
  }


  /** * Tests the processRow pipeline exception. */
  public function testProcessRowPipelineException() {
    $row = new Row();
    $plugin = $this->prophesize(MigrateProcessInterface::class);
    $plugin->getPluginDefinition()->willReturn(['handle_multiples' => FALSE]);
    $plugin->transform(NULL, $this->executable, $row, 'destination_id')
      ->willReturn('transform_return_string');
    $plugin->multiple()->willReturn(TRUE);
    $plugin->getPluginId()->willReturn('plugin_id');
    $plugin = $plugin->reveal();
    $plugins['destination_id'] = [$plugin$plugin];
    $this->migration->method('getProcessPlugins')->willReturn($plugins);

    $this->expectException(MigrateException::class);
    $this->expectExceptionMessage('Pipeline failed at plugin_id plugin for destination destination_id: transform_return_string received instead of an array,');
    $this->executable->processRow($row);
  }

  /** * Tests the processRow method. */
Home | Imprint | This part of the site doesn't use cookies.