public function ParagraphsProcessOnValueTest::testSkip in Paragraphs 8
Test not processing if conditions are not met.
File
- tests/
src/ Unit/ migrate/ ParagraphsProcessOnValueTest.php, line 76
Class
- ParagraphsProcessOnValueTest
- Test class for the paragraphs_process_on_value process plugin.
Namespace
Drupal\Tests\paragraphs\Unit\migrateCode
public function testSkip() {
$migration = $this
->getMigration();
$get = new Get([
'source' => 'theValue',
], 'get', []);
$migration
->expects($this
->any())
->method('getProcessPlugins')
->willReturn([
'destination' => [
$get,
],
]);
$this->row
->expects($this
->any())
->method('getSourceProperty')
->with('source')
->willReturn('unexpected');
$event_dispatcher = $this
->createMock(EventDispatcherInterface::class);
$message = $this
->createMock(MigrateMessageInterface::class);
$migrate_executable = new MigrateExecutable($migration, $message, $event_dispatcher);
$value = $this->plugin
->transform('Initial Value', $migrate_executable, $this->row, 'destination');
$this
->assertEquals('Initial Value', $value);
}