public function XmlPluginTest::testParseValidSlVariantKey in TMGMT Translator Smartling 8.4
Test sl-variant parsing: valid string.
File
- tests/
src/ Kernel/ XmlPluginTest.php, line 60
Class
- XmlPluginTest
- Tests for smartling xml plugin.
Namespace
Drupal\Tests\tmgmt_smartling\KernelCode
public function testParseValidSlVariantKey() {
$parsed_sl_variant = $this
->invokeMethod($this->xmlPlugin, 'parseSmartlingSlVariantKey', [
'node-1-title][0][value',
]);
$this
->assertEqual($parsed_sl_variant['entity_type'], 'node');
$this
->assertEqual($parsed_sl_variant['entity_id'], 1);
$this
->assertEqual($parsed_sl_variant['field_name'], 'title');
$this
->assertEqual($parsed_sl_variant['field_index'], 0);
$this
->assertEqual($parsed_sl_variant['field_value_name'], 'value');
}