MigrateBlockedIpsTest.php in Drupal 9
Same filename and directory in other branches
Namespace
Drupal\Tests\ban\Kernel\Migrate\d7File
core/modules/ban/tests/src/Kernel/Migrate/d7/MigrateBlockedIpsTest.phpView source
<?php
namespace Drupal\Tests\ban\Kernel\Migrate\d7;
use Drupal\Tests\SchemaCheckTestTrait;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
/**
* Migrate blocked IPs.
*
* @group ban
*/
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',
]);
$this
->executeMigration('d7_blocked_ips');
}
/**
* Tests migration of blocked IPs.
*/
public function testBlockedIps() {
$this
->assertTrue(\Drupal::service('ban.ip_manager')
->isBanned('111.111.111.111'));
}
}
Classes
Name | Description |
---|---|
MigrateBlockedIpsTest | Migrate blocked IPs. |