3 namespace Drupal\Tests\file\Unit\Plugin\migrate\process\d6;
5 use Drupal\file\Plugin\migrate\process\d6\CckFile;
6 use Drupal\migrate\Plugin\MigrationInterface;
7 use Drupal\migrate\MigrateExecutableInterface;
8 use Drupal\migrate\Plugin\MigrateProcessInterface;
9 use Drupal\migrate\Row;
10 use Drupal\Tests\UnitTestCase;
16 class CckFileTest extends UnitTestCase {
19 * Tests that alt and title attributes are included in transformed values.
21 public function testTransformAltTitle() {
22 $executable = $this->prophesize(MigrateExecutableInterface::class)->reveal();
23 $row = $this->prophesize(Row::class)->reveal();
24 $migration = $this->prophesize(MigrationInterface::class)->reveal();
26 $migration_plugin = $this->prophesize(MigrateProcessInterface::class);
27 $migration_plugin->transform(1, $executable, $row, 'foo')->willReturn(1);
29 $plugin = new CckFile([], 'd6_cck_file', [], $migration, $migration_plugin->reveal());
33 'title' => 'Wambooli',
38 'data' => serialize($options),
41 $transformed = $plugin->transform($value, $executable, $row, 'foo');
47 'title' => 'Wambooli',
49 $this->assertSame($expected, $transformed);