You are here

public function LegacyBlockVisibilityTest::testTransformMultiplePagesWithFront in Drupal 8

Tests Transform.

@covers ::transform

@expectedDeprecation Passing a migration process plugin as the fifth argument to Drupal\block\Plugin\migrate\process\BlockVisibility::__construct is deprecated in drupal:8.8.0 and will throw an error in drupal:9.0.0. Pass the migrate.lookup service instead. See https://www.drupal.org/node/3047268

File

core/modules/block/tests/src/Unit/Plugin/migrate/process/LegacyBlockVisibilityTest.php, line 77

Class

LegacyBlockVisibilityTest
Tests the block_visibility process plugin.

Namespace

Drupal\Tests\block\Unit\Plugin\migrate\process

Code

public function testTransformMultiplePagesWithFront() {
  $visibility = $this->plugin
    ->transform([
    1,
    "foo\n/bar\rbaz\r\n<front>",
    [],
  ], $this->migrateExecutable, $this->row, 'destinationproperty');
  $this
    ->assertSame('request_path', $visibility['request_path']['id']);
  $this
    ->assertFalse($visibility['request_path']['negate']);
  $this
    ->assertSame("/foo\n/bar\n/baz\n<front>", $visibility['request_path']['pages']);
}