You are here

public function PathTest::testImportPaths in Feeds 8.3

Tests importing paths.

1 call to PathTest::testImportPaths()
PathTest::testImportPathsWithPathauto in tests/src/Kernel/Feeds/Target/PathTest.php
Tests importing paths when pathauto is enabled.

File

tests/src/Kernel/Feeds/Target/PathTest.php, line 78

Class

PathTest
@coversDefaultClass \Drupal\feeds\Feeds\Target\Path @group feeds

Namespace

Drupal\Tests\feeds\Kernel\Feeds\Target

Code

public function testImportPaths() {

  // Import.
  $feed = $this
    ->createFeed($this->feedType
    ->id(), [
    'source' => $this
      ->resourcesPath() . '/csv/content.csv',
  ]);
  $feed
    ->import();
  $expected = [
    1 => '/lorem-ipsum-dolor',
    2 => '/ut-wisi-enim',
  ];
  foreach ($expected as $nid => $value) {
    $node = Node::load($nid);
    $this
      ->assertEquals($value, $node->path->alias);
  }
}