You are here

public function CopyTest::testCopyTo in Tamper 8

Test copy to.

File

tests/src/Unit/Plugin/Tamper/CopyTest.php, line 40

Class

CopyTest
Tests the copy plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testCopyTo() {
  $config = [
    Copy::SETTING_TO_FROM => 'to',
    Copy::SETTING_SOURCE => 'title',
  ];
  $expected = [
    'title' => 'Robots are scary!',
    'body' => 'Robots are scary!',
  ];
  $plugin = new Copy($config, 'copy', [], $this
    ->getMockSourceDefinition());
  $item = $this
    ->getTamperItem();
  $this
    ->assertEquals('Robots are scary!', $plugin
    ->tamper('Robots are scary!', $item));
}