class ConvertTokensTest in Zircon Profile 8.0
Same name and namespace in other branches
- 8 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\UnitTestCase extends \Drupal\Tests\PHPUnit_Framework_TestCase
- class \Drupal\Tests\migrate\Unit\MigrateTestCase
- class \Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase
- class \Drupal\Tests\user\Unit\Plugin\migrate\process\ConvertTokensTest
- class \Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase
- class \Drupal\Tests\migrate\Unit\MigrateTestCase
Expanded class hierarchy of ConvertTokensTest
File
- core/
modules/ user/ tests/ src/ Unit/ Plugin/ migrate/ process/ ConvertTokensTest.php, line 18 - Contains \Drupal\Tests\user\Unit\Plugin\migrate\process\ConvertTokensTest.
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, 'destinationproperty');
$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, 'destinationproperty');
$this
->assertEquals('', $value);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConvertTokensTest:: |
protected | function |
Overrides MigrateProcessTestCase:: |
|
ConvertTokensTest:: |
public | function | Tests conversion of user tokens. | |
ConvertTokensTest:: |
public | function | Tests conversion of user tokens with a NULL value. | |
MigrateProcessTestCase:: |
protected | property | ||
MigrateProcessTestCase:: |
protected | property | ||
MigrateProcessTestCase:: |
protected | property | ||
MigrateTestCase:: |
protected | property | ||
MigrateTestCase:: |
protected | property | 74 | |
MigrateTestCase:: |
protected | property | Local store for mocking setStatus()/getStatus(). | |
MigrateTestCase:: |
protected | function | Generates a table schema from a row. | |
MigrateTestCase:: |
protected | function | Get an SQLite database connection object for use in tests. | |
MigrateTestCase:: |
protected | function | Retrieve a mocked migration. | |
MigrateTestCase:: |
protected | function | 1 | |
MigrateTestCase:: |
public | function | Tests a query | |
MigrateTestCase:: |
protected | function | Asserts tested values during test retrieval. | |
UnitTestCase:: |
protected | property | The random generator. | |
UnitTestCase:: |
protected | property | The app root. | |
UnitTestCase:: |
protected | function | Asserts if two arrays are equal by sorting them first. | |
UnitTestCase:: |
protected | function | Mocks a block with a block plugin. | |
UnitTestCase:: |
protected | function | Returns a stub class resolver. | |
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed in array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
protected | function | Sets up a container with a cache tags invalidator. | |
UnitTestCase:: |
protected | function | Gets the random generator for the utility methods. | |
UnitTestCase:: |
public | function | Returns a stub translation manager that just returns the passed string. | |
UnitTestCase:: |
public | function | Generates a unique random string containing letters and numbers. |