public function PathTest::testUpdateNodePaths in Feeds 8.3
Tests updating paths.
1 call to PathTest::testUpdateNodePaths()
- PathTest::testUpdateNodePathsWithPathauto in tests/
src/ Kernel/ Feeds/ Target/ PathTest.php - Tests importing paths when pathauto is enabled.
File
- tests/
src/ Kernel/ Feeds/ Target/ PathTest.php, line 99
Class
- PathTest
- @coversDefaultClass \Drupal\feeds\Feeds\Target\Path @group feeds
Namespace
Drupal\Tests\feeds\Kernel\Feeds\TargetCode
public function testUpdateNodePaths() {
// Create a node with an alias.
$node = Node::create([
'title' => 'Lorem ipsum',
'type' => 'article',
'path' => [
'alias' => 'lorie',
'pathauto' => 0,
],
]);
$node
->save();
$this
->assertEquals('lorie', $node->path->alias);
// Import.
$feed = $this
->createFeed($this->feedType
->id(), [
'source' => $this
->resourcesPath() . '/csv/content.csv',
]);
$feed
->import();
$node = $this
->reloadEntity($node);
$this
->assertEquals('/lorem-ipsum-dolor', $node->path->alias);
}