Verified Commit 4936c9bd authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3260391 by huzooka, arunkumark, Spokje, quietone: BlockedIp::import...

Issue #3260391 by huzooka, arunkumark, Spokje, quietone: BlockedIp::import violates MigrateDestinationInterface::import
parent 2316fd5b
......@@ -78,6 +78,8 @@ public function fields() {
*/
public function import(Row $row, array $old_destination_id_values = []) {
$this->banManager->banIp($row->getDestinationProperty('ip'));
return ['ip' => $row->getDestinationProperty('ip')];
}
}
......@@ -27,13 +27,15 @@ class MigrateBlockedIpsTest extends MigrateDrupal7TestBase {
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->startCollectingMessages();
$this->executeMigration('d7_blocked_ips');
$this->assertEmpty($this->migrateMessages);
$this->assertTrue(\Drupal::service('ban.ip_manager')->isBanned('111.111.111.111'));
}
......
......@@ -800,11 +800,6 @@ parameters:
count: 1
path: modules/action/src/Form/ActionFormBase.php
-
message: "#^Method Drupal\\\\ban\\\\Plugin\\\\migrate\\\\destination\\\\BlockedIp\\:\\:import\\(\\) should return array\\|bool but return statement is missing\\.$#"
count: 1
path: modules/ban/src/Plugin/migrate/destination/BlockedIp.php
-
message: "#^\\#lazy_builder callback 'hello_or_yarhar' at key '0' is not callable\\.$#"
count: 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment