FilterFormatPermissionTest.php in Drupal 8
File
core/modules/filter/tests/src/Kernel/Migrate/d6/FilterFormatPermissionTest.php
View source
<?php
namespace Drupal\Tests\filter\Kernel\Migrate\d6;
use Drupal\filter\Plugin\migrate\process\d6\FilterFormatPermission;
use Drupal\migrate\Plugin\MigrateProcessInterface;
use Drupal\migrate\Plugin\Migration;
use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
class FilterFormatPermissionTest extends MigrateDrupalTestBase {
public function testConfigurableFilterFormat() {
$migration = Migration::create($this->container, [], 'custom_migration', []);
$filterFormatPermissionMigration = FilterFormatPermission::create($this->container, [
'migration' => 'custom_filter_format',
], 'custom_filter_format', [], $migration);
$config = $this
->readAttribute($filterFormatPermissionMigration, 'configuration');
$this
->assertEquals($config['migration'], 'custom_filter_format');
}
public function testLegacyConstruct() {
$process_plugin = $this
->prophesize(MigrateProcessInterface::class)
->reveal();
$plugin = new FilterFormatPermission([], '', [], $this
->prophesize(MigrationInterface::class)
->reveal(), $process_plugin);
$this
->assertSame($process_plugin, $this
->readAttribute($plugin, 'migrationPlugin'));
}
}