function FieldLinkTest::testCanonicalizeUriSerialized
Tests the attributes that are deeply serialized are discarded.
File
-
core/
modules/ link/ tests/ src/ Unit/ Plugin/ migrate/ process/ FieldLinkTest.php, line 111
Class
- FieldLinkTest
- @group Link
Namespace
Drupal\Tests\link\Unit\Plugin\migrate\processCode
public function testCanonicalizeUriSerialized() {
$link_plugin = new FieldLink([], '', [], $this->createMock(MigrationInterface::class));
$migrate_executable = $this->createMock(MigrateExecutableInterface::class);
$row = new Row();
$transformed = $link_plugin->transform([
'url' => '',
'title' => '',
'attributes' => serialize(serialize([
'not too deep',
])),
], $migrate_executable, $row, NULL);
$this->assertEquals([
'not too deep',
], $transformed['options']['attributes']);
$transformed = $link_plugin->transform([
'url' => '',
'title' => '',
'attributes' => serialize(serialize(serialize([
'too deep',
]))),
], $migrate_executable, $row, NULL);
$this->assertEmpty($transformed['options']['attributes']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.