class ConvertTokensTest
Same name and namespace in other branches
- 11.x core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php \Drupal\Tests\user\Unit\Plugin\migrate\process\ConvertTokensTest
- 10 core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php \Drupal\Tests\user\Unit\Plugin\migrate\process\ConvertTokensTest
- 9 core/modules/user/tests/src/Unit/Plugin/migrate/process/ConvertTokensTest.php \Drupal\Tests\user\Unit\Plugin\migrate\process\ConvertTokensTest
Tests the ConvertTokens plugin.
@group user
Hierarchy
- class \Drupal\Tests\user\Unit\Plugin\migrate\process\ConvertTokensTest extends \Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase
Expanded class hierarchy of ConvertTokensTest
File
-
core/
modules/ user/ tests/ src/ Unit/ Plugin/ migrate/ process/ ConvertTokensTest.php, line 13
Namespace
Drupal\Tests\user\Unit\Plugin\migrate\processView source
class ConvertTokensTest extends MigrateProcessTestCase {
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->plugin = new ConvertTokens([], 'convert_tokens', []);
}
/**
* Tests conversion of user tokens.
*/
public function testConvertTokens() {
$value = $this->plugin
->transform('Account details for !username at !site', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertEquals('Account details for [user:name] at [site:name]', $value);
}
/**
* Tests conversion of user tokens with a NULL value.
*/
public function testConvertTokensNull() {
$value = $this->plugin
->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
$this->assertEquals('', $value);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.