View source
<?php
namespace Drupal\Tests\filter\Kernel\Plugin\migrate\source\d7;
use Drupal\Tests\migrate\Kernel\MigrateSqlSourceTestBase;
class FilterFormatTest extends MigrateSqlSourceTestBase {
public static $modules = [
'filter',
'migrate_drupal',
];
public function providerSource() {
$tests = [];
$tests[0]['source_data']['filter_format'] = [
[
'format' => 'custom_text_format',
'name' => 'Custom Text format',
'cache' => 1,
'status' => 1,
'weight' => 0,
],
[
'format' => 'full_html',
'name' => 'Full HTML',
'cache' => 1,
'status' => 1,
'weight' => 1,
],
];
$tests[0]['source_data']['filter'] = [
[
'format' => 'custom_text_format',
'module' => 'filter',
'name' => 'filter_autop',
'weight' => 0,
'status' => 1,
'settings' => serialize([]),
],
[
'format' => 'custom_text_format',
'module' => 'filter',
'name' => 'filter_html',
'weight' => 1,
'status' => 1,
'settings' => serialize([]),
],
[
'format' => 'full_html',
'module' => 'filter',
'name' => 'filter_url',
'weight' => 0,
'status' => 1,
'settings' => serialize([]),
],
];
$tests[0]['expected_data'] = [
[
'format' => 'custom_text_format',
'name' => 'Custom Text format',
'cache' => 1,
'status' => 1,
'weight' => 0,
'filters' => [
'filter_autop' => [
'format' => 'custom_text_format',
'module' => 'filter',
'name' => 'filter_autop',
'weight' => 0,
'status' => 1,
'settings' => [],
],
'filter_html' => [
'format' => 'custom_text_format',
'module' => 'filter',
'name' => 'filter_html',
'weight' => 1,
'status' => 1,
'settings' => [],
],
],
],
[
'format' => 'full_html',
'name' => 'Full HTML',
'cache' => 1,
'status' => 1,
'weight' => 1,
'filters' => [
'filter_url' => [
'format' => 'full_html',
'module' => 'filter',
'name' => 'filter_url',
'weight' => 0,
'status' => 1,
'settings' => [],
],
],
],
];
return $tests;
}
}