You are here

public function CallbackTest::testCallbackWithClassMethod in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/process/CallbackTest.php \Drupal\Tests\migrate\Unit\process\CallbackTest::testCallbackWithClassMethod()

Test callback with a class method as callable.

File

core/modules/migrate/tests/src/Unit/process/CallbackTest.php, line 39
Contains \Drupal\Tests\migrate\Unit\process\CallbackTest.

Class

CallbackTest
Tests the callback process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testCallbackWithClassMethod() {
  $this->plugin
    ->setCallable(array(
    '\\Drupal\\Component\\Utility\\Unicode',
    'strtolower',
  ));
  $value = $this->plugin
    ->transform('FooBar', $this->migrateExecutable, $this->row, 'destinationproperty');
  $this
    ->assertSame($value, 'foobar');
}