You are here

public function CopyTest::testCopyFrom in Tamper 8

Test copy from.

File

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

Class

CopyTest
Tests the copy plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

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