Issue #3260391 by huzooka, arunkumark, Spokje, quietone: BlockedIp::import violates MigrateDestinationInterface::import
parent
2316fd5b29
commit
4936c9bd07
|
@ -78,6 +78,8 @@ class BlockedIp extends DestinationBase implements ContainerFactoryPluginInterfa
|
|||
*/
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue