function MigrateSqlIdMapTest::testGetHighestIdInvalid

Same name in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::testGetHighestIdInvalid()
  2. 10 core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::testGetHighestIdInvalid()
  3. 11.x core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::testGetHighestIdInvalid()

Tests getHighestId method with invalid data.

@dataProvider getHighestIdInvalidDataProvider

Parameters

array $destination_ids: Array of destination ids.

File

core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php, line 1142

Class

MigrateSqlIdMapTest
Tests the SQL ID map plugin.

Namespace

Drupal\Tests\migrate\Unit

Code

public function testGetHighestIdInvalid(array $destination_ids) {
    $this->expectException(\LogicException::class);
    $this->expectExceptionMessage('To determine the highest migrated ID the first ID must be an integer');
    $this->destinationIds = $destination_ids;
    $id_map = $this->getIdMap();
    $id_map->getHighestId();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.