setMigration example

->method('getDatabase')
      ->willReturn($id_map_connection);

    // Setup a migration entity.     $migration = $this->createMock(MigrationInterface::class);
    $migration->expects($with_id_map ? $this->once() : $this->never())
      ->method('getIdMap')
      ->willReturn($id_map_is_sql ? $sql : NULL);

    // Create our SqlBase test class.     $sql_base = new TestSqlBase();
    $sql_base->setMigration($migration);
    $sql_base->setDatabase($source_connection);

    // Configure the idMap to make the check in mapJoinable() pass.     if ($with_id_map) {
      $sql_base->setIds([
        'uid' => ['type' => 'integer', 'alias' => 'u'],
      ]);
    }

    $this->assertEquals($expected_result$sql_base->mapJoinable());
  }

  
Home | Imprint | This part of the site doesn't use cookies.