class MigrateBlockedIpsTest

Same name and namespace in other branches
  1. 11.x core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php \Drupal\Tests\ban\Kernel\Migrate\d7\MigrateBlockedIpsTest

Migrate blocked IPs.

@group ban

Hierarchy

Expanded class hierarchy of MigrateBlockedIpsTest

File

core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.php, line 13

Namespace

Drupal\Tests\ban\Kernel\Migrate\d7
View source
class MigrateBlockedIpsTest extends MigrateDrupal7TestBase {
  use SchemaCheckTestTrait;
  
  /**
   * Modules to enable.
   *
   * @var array
   */
  protected static $modules = [
    'ban',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->installSchema('ban', [
      'ban_ip',
    ]);
  }
  
  /**
   * Tests migration of blocked IPs.
   */
  public function testBlockedIps() {
    $this->startCollectingMessages();
    $this->executeMigration('d7_blocked_ips');
    $this->assertEmpty($this->migrateMessages);
    $this->assertTrue(\Drupal::service('ban.ip_manager')->isBanned('111.111.111.111'));
  }

}

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