public function ConfigActionsTransformTest::testParseWildcards in Config Actions 8
@covers ::parseWildcards
File
- tests/
src/ Unit/ ConfigActionsTransformTest.php, line 123
Class
- ConfigActionsTransformTest
- test the ConfigActionsTransform class
Namespace
Drupal\Tests\config_actions\UnitCode
public function testParseWildcards() {
$replace = [
'@name@' => 'old name',
'@type@' => 'old type',
'@other@' => 'existing',
];
// Directly testing the code used in ConfigActionsPluginBase to merge
// existing replacements with parsed key wildcards.
$replace = array_merge($replace, ConfigActionsTransform::parseWildcards('@name@.@type@', 'hello.world'));
$this
->assertEquals('hello', $replace['@name@']);
$this
->assertEquals('world', $replace['@type@']);
$this
->assertEquals('existing', $replace['@other@']);
$result = ConfigActionsTransform::parseWildcards('blog.@name@.@type@', 'hello.world');
$this
->assertEquals([], $result);
}