BlockedIpsTest.php 712 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?php

namespace Drupal\Tests\ban\Kernel\Plugin\migrate\source\d7;

use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;

/**
 * Tests D7 blocked_ip source plugin.
 *
 * @covers \Drupal\ban\Plugin\migrate\source\d7\BlockedIps
 * @group ban
 */
class BlockedIpsTest extends MigrateSqlSourceTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = ['ban', 'migrate_drupal'];

  /**
   * {@inheritdoc}
   */
  public function providerSource() {
    $tests = [];

    $tests[0]['source_data']['blocked_ips'] = [
      [
        'iid' => 1,
        'ip' => '127.0.0.1',
      ]
    ];
    $tests[0]['expected_data'] = [
      [
        'ip' => '127.0.0.1',
      ],
    ];
    return $tests;
  }

}