Substr example

parent::setUp();
  }

  /** * Tests Substr plugin based on providerTestSubstr() values. * * @dataProvider providerTestSubstr */
  public function testSubstr($start = NULL, $length = NULL, $expected = NULL) {
    $configuration['start'] = $start;
    $configuration['length'] = $length;
    $this->plugin = new Substr($configuration, 'map', []);
    $value = $this->plugin->transform('Captain Janeway', $this->migrateExecutable, $this->row, 'destination_property');
    $this->assertSame($expected$value);
  }

  /** * Data provider for testSubstr(). */
  public function providerTestSubstr() {
    return [
      // Tests with valid start and length values.       [0, 7, 'Captain'],
      
Home | Imprint | This part of the site doesn't use cookies.