Issue #2807845 by quietone: Convert Ban's Migrate source tests to new base class
parent
e672f610e4
commit
9baedb6e84
|
@ -0,0 +1,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;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\ban\Unit\Plugin\migrate\source\d7;
|
||||
|
||||
use Drupal\Tests\migrate\Unit\MigrateSqlSourceTestCase;
|
||||
|
||||
/**
|
||||
* Tests D7 blocked_ip source plugin.
|
||||
*
|
||||
* @coversDefaultClass \Drupal\ban\Plugin\migrate\source\d7\BlockedIps
|
||||
* @group ban
|
||||
*/
|
||||
class BlockedIpsTest extends MigrateSqlSourceTestCase {
|
||||
|
||||
const PLUGIN_CLASS = 'Drupal\ban\Plugin\migrate\source\d7\BlockedIps';
|
||||
|
||||
protected $migrationConfiguration = [
|
||||
'id' => 'test',
|
||||
'source' => [
|
||||
'plugin' => 'd7_blocked_ips',
|
||||
],
|
||||
];
|
||||
|
||||
protected $expectedResults = [
|
||||
[
|
||||
'ip' => '127.0.0.1',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
$this->databaseContents['blocked_ips'] = [
|
||||
[
|
||||
'iid' => 1,
|
||||
'ip' => '127.0.0.1',
|
||||
]
|
||||
];
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue