init
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module;
|
||||
|
||||
use Magento\Framework\Setup\ModuleDataSetupInterface;
|
||||
|
||||
class DataSetupTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var ModuleDataSetupInterface
|
||||
*/
|
||||
protected $_model;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
|
||||
\Magento\Setup\Module\DataSetup::class
|
||||
);
|
||||
}
|
||||
|
||||
public function testUpdateTableRow()
|
||||
{
|
||||
$original = $this->_model->getTableRow('setup_module', 'module', 'Magento_AdminNotification', 'schema_version');
|
||||
$this->_model->updateTableRow('setup_module', 'module', 'Magento_AdminNotification', 'schema_version', 'test');
|
||||
$this->assertEquals(
|
||||
'test',
|
||||
$this->_model->getTableRow('setup_module', 'module', 'Magento_AdminNotification', 'schema_version')
|
||||
);
|
||||
$this->_model->updateTableRow(
|
||||
'setup_module',
|
||||
'module',
|
||||
'Magento_AdminNotification',
|
||||
'schema_version',
|
||||
$original
|
||||
);
|
||||
}
|
||||
|
||||
public function testDeleteTableRow()
|
||||
{
|
||||
$this->expectException(\Magento\Framework\DB\Adapter\TableNotFoundException::class);
|
||||
|
||||
$this->_model->deleteTableRow('setup/module', 'module', 'integration_test_fixture_setup');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\DataSetup::updateTableRow
|
||||
*/
|
||||
public function testUpdateTableRowNameConversion()
|
||||
{
|
||||
$this->expectException(\Magento\Framework\DB\Adapter\TableNotFoundException::class);
|
||||
|
||||
$original = $this->_model->getTableRow('setup_module', 'module', 'core_setup', 'schema_version');
|
||||
$this->_model->updateTableRow('setup/module', 'module', 'core_setup', 'schema_version', $original);
|
||||
}
|
||||
|
||||
public function testTableExists()
|
||||
{
|
||||
$this->assertTrue($this->_model->tableExists('store_website'));
|
||||
$this->assertFalse($this->_model->tableExists('core/website'));
|
||||
}
|
||||
|
||||
public function testGetSetupCache()
|
||||
{
|
||||
$this->assertInstanceOf(\Magento\Framework\Setup\DataCacheInterface::class, $this->_model->getSetupCache());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\Dependency;
|
||||
|
||||
class CircularTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var Circular
|
||||
*/
|
||||
protected $circular;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->circular = new Circular();
|
||||
}
|
||||
|
||||
public function testBuildCircularDependencies()
|
||||
{
|
||||
$dependencies = [1 => [2], 2 => [3, 5], 3 => [1], 5 => [2]];
|
||||
$expectedCircularDependencies = [
|
||||
1 => [[1, 2, 3, 1]],
|
||||
2 => [[2, 3, 1, 2], [2, 5, 2]],
|
||||
3 => [[3, 1, 2, 3]],
|
||||
5 => [[5, 2, 5]],
|
||||
];
|
||||
$this->assertEquals($expectedCircularDependencies, $this->circular->buildCircularDependencies($dependencies));
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\Dependency\Parser\Composer;
|
||||
|
||||
class JsonTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fixtureDir;
|
||||
|
||||
/**
|
||||
* @var Json
|
||||
*/
|
||||
protected $parser;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->fixtureDir = realpath(__DIR__ . '/../../_files') . '/';
|
||||
|
||||
$this->parser = new Json();
|
||||
}
|
||||
|
||||
public function testParse()
|
||||
{
|
||||
$expected = [
|
||||
[
|
||||
'name' => 'magento/module-module1',
|
||||
'dependencies' => [
|
||||
['module' => 'magento/module-module2', 'type' => 'hard'],
|
||||
['module' => 'magento/module-backend', 'type' => 'soft'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'magento/module-module2',
|
||||
'dependencies' => [
|
||||
['module' => 'magento/module-module3', 'type' => 'hard'],
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
$actual = $this->parser->parse(
|
||||
[
|
||||
'files_for_parse' => [
|
||||
$this->fixtureDir . 'composer1.json',
|
||||
$this->fixtureDir . 'composer2.json',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\Dependency\Parser\Config;
|
||||
|
||||
class XmlTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fixtureDir;
|
||||
|
||||
/**
|
||||
* @var Xml
|
||||
*/
|
||||
protected $parser;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->fixtureDir = realpath(__DIR__ . '/../../_files') . '/';
|
||||
|
||||
$this->parser = new Xml();
|
||||
}
|
||||
|
||||
public function testParse()
|
||||
{
|
||||
$expected = [
|
||||
'Magento\Module1',
|
||||
'Magento\Module2',
|
||||
];
|
||||
|
||||
$actual = $this->parser->parse(
|
||||
['files_for_parse' => [$this->fixtureDir . 'module1.xml', $this->fixtureDir . 'module2.xml']]
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\Dependency\Report;
|
||||
|
||||
use Magento\Setup\Module\Dependency\ServiceLocator;
|
||||
|
||||
class CircularTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fixtureDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $sourceFilename;
|
||||
|
||||
/**
|
||||
* @var BuilderInterface
|
||||
*/
|
||||
protected $builder;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->fixtureDir = realpath(__DIR__ . '/../_files') . '/';
|
||||
$this->sourceFilename = $this->fixtureDir . 'circular-dependencies.csv';
|
||||
|
||||
$this->builder = ServiceLocator::getCircularDependenciesReportBuilder();
|
||||
}
|
||||
|
||||
public function testBuild()
|
||||
{
|
||||
$this->builder->build(
|
||||
[
|
||||
'parse' => [
|
||||
'files_for_parse' => [$this->fixtureDir . 'composer4.json', $this->fixtureDir . 'composer5.json'],
|
||||
],
|
||||
'write' => ['report_filename' => $this->sourceFilename],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertFileEquals($this->fixtureDir . 'expected/circular-dependencies.csv', $this->sourceFilename);
|
||||
}
|
||||
|
||||
public function testBuildWithoutDependencies()
|
||||
{
|
||||
$this->builder->build(
|
||||
[
|
||||
'parse' => ['files_for_parse' => [$this->fixtureDir . 'composer3.json']],
|
||||
'write' => ['report_filename' => $this->sourceFilename],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertFileEquals(
|
||||
$this->fixtureDir . 'expected/without-circular-dependencies.csv',
|
||||
$this->sourceFilename
|
||||
);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
if (file_exists($this->sourceFilename)) {
|
||||
unlink($this->sourceFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\Dependency\Report;
|
||||
|
||||
use Magento\Setup\Module\Dependency\ServiceLocator;
|
||||
|
||||
class DependencyTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fixtureDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $sourceFilename;
|
||||
|
||||
/**
|
||||
* @var BuilderInterface
|
||||
*/
|
||||
protected $builder;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->fixtureDir = realpath(__DIR__ . '/../_files') . '/';
|
||||
$this->sourceFilename = $this->fixtureDir . 'dependencies.csv';
|
||||
|
||||
$this->builder = ServiceLocator::getDependenciesReportBuilder();
|
||||
}
|
||||
|
||||
public function testBuild()
|
||||
{
|
||||
$this->builder->build(
|
||||
[
|
||||
'parse' => [
|
||||
'files_for_parse' => [$this->fixtureDir . 'composer1.json', $this->fixtureDir . 'composer2.json'],
|
||||
],
|
||||
'write' => ['report_filename' => $this->sourceFilename],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertFileEquals($this->fixtureDir . 'expected/dependencies.csv', $this->sourceFilename);
|
||||
}
|
||||
|
||||
public function testBuildWithoutDependencies()
|
||||
{
|
||||
$this->builder->build(
|
||||
[
|
||||
'parse' => ['files_for_parse' => [$this->fixtureDir . 'composer3.json']],
|
||||
'write' => ['report_filename' => $this->sourceFilename],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertFileEquals($this->fixtureDir . 'expected/without-dependencies.csv', $this->sourceFilename);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
if (file_exists($this->sourceFilename)) {
|
||||
unlink($this->sourceFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\Dependency\Report;
|
||||
|
||||
use Magento\Setup\Module\Dependency\ServiceLocator;
|
||||
|
||||
class FrameworkTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fixtureDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $fixtureDirModule;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $sourceFilename;
|
||||
|
||||
/**
|
||||
* @var BuilderInterface
|
||||
*/
|
||||
protected $builder;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->fixtureDir = realpath(__DIR__ . '/../_files') . '/';
|
||||
$this->fixtureDirModule = $this->fixtureDir . 'code/Magento/FirstModule/';
|
||||
$this->sourceFilename = $this->fixtureDir . 'framework-dependencies.csv';
|
||||
|
||||
$this->builder = ServiceLocator::getFrameworkDependenciesReportBuilder();
|
||||
}
|
||||
|
||||
public function testBuild()
|
||||
{
|
||||
$this->builder->build(
|
||||
[
|
||||
'parse' => [
|
||||
'files_for_parse' => [
|
||||
$this->fixtureDirModule . 'Helper/Helper.php',
|
||||
$this->fixtureDirModule . 'Model/Model.php',
|
||||
$this->fixtureDirModule . 'view/frontend/template.phtml',
|
||||
],
|
||||
'config_files' => [$this->fixtureDirModule . 'etc/module.xml'],
|
||||
'declared_namespaces' => ['Magento'],
|
||||
],
|
||||
'write' => ['report_filename' => $this->sourceFilename],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertFileEquals($this->fixtureDir . 'expected/framework-dependencies.csv', $this->sourceFilename);
|
||||
}
|
||||
|
||||
public function testBuildWithoutDependencies()
|
||||
{
|
||||
$this->builder->build(
|
||||
[
|
||||
'parse' => [
|
||||
'files_for_parse' => [$this->fixtureDirModule . 'Model/WithoutDependencies.php'],
|
||||
'config_files' => [$this->fixtureDirModule . 'etc/module.xml'],
|
||||
'declared_namespaces' => ['Magento'],
|
||||
],
|
||||
'write' => ['report_filename' => $this->sourceFilename],
|
||||
]
|
||||
);
|
||||
|
||||
$this->assertFileEquals(
|
||||
$this->fixtureDir . 'expected/without-framework-dependencies.csv',
|
||||
$this->sourceFilename
|
||||
);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
if (file_exists($this->sourceFilename)) {
|
||||
unlink($this->sourceFilename);
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\FirstModule\Helper;
|
||||
|
||||
class Helper
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
new Magento\LibFirst();
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\FirstModule\Model;
|
||||
|
||||
use Magento\LibSecond;
|
||||
|
||||
class Model
|
||||
{
|
||||
/**
|
||||
* @use Magento\LibSecond()
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
new LibSecond();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\FirstModule\Model;
|
||||
|
||||
class WithoutDependencies
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_FirstModule"/>
|
||||
</config>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php new Magento\Third();
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "magento/module-module1",
|
||||
"description": "N/A",
|
||||
"require": {
|
||||
"php": "~5.6.0|7.0.2|^7.0.6",
|
||||
"magento/module-module2": "0.1.0-alpha103"
|
||||
},
|
||||
"suggest": {
|
||||
"magento/module-backend": "0.1.0-alpha103"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"version": "0.1.0-alpha103"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "magento/module-module2",
|
||||
"description": "N/A",
|
||||
"require": {
|
||||
"php": "~5.6.0|7.0.2|^7.0.6",
|
||||
"magento/module-module3": "0.1.0-alpha103"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"version": "0.1.0-alpha103"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "magento/module-module1",
|
||||
"description": "N/A",
|
||||
"require": {
|
||||
"php": "~5.6.0|7.0.2|^7.0.6"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"version": "0.1.0-alpha103"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "magento/module-module1",
|
||||
"description": "N/A",
|
||||
"require": {
|
||||
"php": "~5.6.0|7.0.2|^7.0.6",
|
||||
"magento/module-module2": "0.1.0-alpha103"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"version": "0.1.0-alpha103"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "magento/module-module2",
|
||||
"description": "N/A",
|
||||
"require": {
|
||||
"php": "~5.6.0|7.0.2|^7.0.6",
|
||||
"magento/module-module1": "0.1.0-alpha103"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"version": "0.1.0-alpha103"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
"Circular dependencies:","Total number of chains"
|
||||
,2
|
||||
|
||||
"Circular dependencies for each module:",
|
||||
magento/module-module1,1
|
||||
magento/module-module1->magento/module-module2->magento/module-module1
|
||||
|
||||
magento/module-module2,1
|
||||
magento/module-module2->magento/module-module1->magento/module-module2
|
||||
|
+10
@@ -0,0 +1,10 @@
|
||||
,All,Hard,Soft
|
||||
"Total number of dependencies",3,2,1
|
||||
|
||||
"Dependencies for each module:",All,Hard,Soft
|
||||
magento/module-module1,2,1,1
|
||||
" -- magento/module-module2",,1,0
|
||||
" -- magento/module-backend",,0,1
|
||||
|
||||
magento/module-module2,1,1,0
|
||||
" -- magento/module-module3",,1,0
|
||||
|
+8
@@ -0,0 +1,8 @@
|
||||
"Dependencies of framework:","Total number"
|
||||
,3
|
||||
|
||||
"Dependencies for each module:",
|
||||
Magento\FirstModule,3
|
||||
" -- Magento\LibFirst",1
|
||||
" -- Magento\LibSecond",2
|
||||
" -- Magento\Third",1
|
||||
|
+2
@@ -0,0 +1,2 @@
|
||||
"Circular dependencies:","Total number of chains"
|
||||
,0
|
||||
|
+2
@@ -0,0 +1,2 @@
|
||||
,All,Hard,Soft
|
||||
"Total number of dependencies",0,0,0
|
||||
|
+2
@@ -0,0 +1,2 @@
|
||||
"Dependencies of framework:","Total number"
|
||||
,0
|
||||
|
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_Module1">
|
||||
</module>
|
||||
</config>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
|
||||
<module name="Magento_Module2">
|
||||
</module>
|
||||
</config>
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\I18n\Dictionary;
|
||||
|
||||
use Magento\Framework\Component\ComponentRegistrar;
|
||||
use Magento\Setup\Module\I18n\Dictionary\Generator;
|
||||
use Magento\Setup\Module\I18n\ServiceLocator;
|
||||
|
||||
class GeneratorTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $testDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $expectedDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $outputFileName;
|
||||
|
||||
/**
|
||||
* @var \Magento\Setup\Module\I18n\Dictionary\Generator
|
||||
*/
|
||||
protected $generator;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $backupRegistrar;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$reflection = new \ReflectionClass(\Magento\Framework\Component\ComponentRegistrar::class);
|
||||
$paths = $reflection->getProperty('paths');
|
||||
$paths->setAccessible(true);
|
||||
$this->backupRegistrar = $paths->getValue();
|
||||
$paths->setValue(null, ['module' => [], 'theme' => []]);
|
||||
$paths->setAccessible(false);
|
||||
|
||||
$this->testDir = realpath(__DIR__ . '/_files');
|
||||
$this->expectedDir = $this->testDir . '/expected';
|
||||
$this->source = $this->testDir . '/source';
|
||||
$this->outputFileName = $this->testDir . '/translate.csv';
|
||||
|
||||
// Register the test modules
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::MODULE,
|
||||
'Magento_FirstModule',
|
||||
$this->source . '/app/code/Magento/FirstModule'
|
||||
);
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::MODULE,
|
||||
'Magento_SecondModule',
|
||||
$this->source . '/app/code/Magento/SecondModule'
|
||||
);
|
||||
|
||||
// Register the test theme
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::THEME,
|
||||
'adminhtml/default/backend',
|
||||
$this->source . '/app/design/adminhtml/default/backend'
|
||||
);
|
||||
|
||||
$this->generator = ServiceLocator::getDictionaryGenerator();
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
if (file_exists($this->outputFileName)) {
|
||||
unlink($this->outputFileName);
|
||||
}
|
||||
$property = new \ReflectionProperty(\Magento\Setup\Module\I18n\ServiceLocator::class, '_dictionaryGenerator');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue(null, null);
|
||||
$property->setAccessible(false);
|
||||
|
||||
$reflection = new \ReflectionClass(\Magento\Framework\Component\ComponentRegistrar::class);
|
||||
$paths = $reflection->getProperty('paths');
|
||||
$paths->setAccessible(true);
|
||||
$paths->setValue(null, $this->backupRegistrar);
|
||||
$paths->setAccessible(false);
|
||||
}
|
||||
|
||||
public function testGenerationWithoutContext()
|
||||
{
|
||||
$this->generator->generate($this->source, $this->outputFileName);
|
||||
|
||||
$this->assertFileEquals($this->expectedDir . '/without_context.csv', $this->outputFileName);
|
||||
}
|
||||
|
||||
public function testGenerationWithContext()
|
||||
{
|
||||
$this->generator->generate($this->source, $this->outputFileName, true);
|
||||
|
||||
$expected = explode(PHP_EOL, file_get_contents($this->expectedDir . '/with_context.csv'));
|
||||
$output = file_get_contents($this->outputFileName);
|
||||
foreach ($expected as $line) {
|
||||
if ($line) {
|
||||
$this->assertStringContainsString($line, $output);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
Helper,Helper,module,Magento_FirstModule
|
||||
Model,Model,module,Magento_FirstModule
|
||||
"Module template","Module template",module,Magento_FirstModule
|
||||
Model,Model,module,Magento_SecondModule
|
||||
"Theme template","Theme template",theme,adminhtml/default/backend
|
||||
"Module js","Module js",module,Magento_FirstModule
|
||||
"Lib js","Lib js",lib,lib/web/mage/file.js
|
||||
"Lib js","Lib js",lib,lib/web/varien/file.js
|
||||
"Module layout label","Module layout label",module,Magento_FirstModule
|
||||
"Module layout title","Module layout title",module,Magento_FirstModule
|
||||
"Theme layout label","Theme layout label",theme,adminhtml/default/backend
|
||||
"Theme layout title","Theme layout title",theme,adminhtml/default/backend
|
||||
|
+13
@@ -0,0 +1,13 @@
|
||||
Helper,Helper
|
||||
Model,Model
|
||||
"Module template","Module template"
|
||||
"Theme template","Theme template"
|
||||
"Model unused","Model unused"
|
||||
"Theme template unused","Theme template unused"
|
||||
"Module js","Module js"
|
||||
"Lib js","Lib js"
|
||||
"Lib js unused","Lib js unused"
|
||||
"Module layout label","Module layout label"
|
||||
"Module layout title","Module layout title"
|
||||
"Theme layout label","Theme layout label"
|
||||
"Theme layout title","Theme layout title"
|
||||
|
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\FirstModule\Helper;
|
||||
|
||||
class Helper
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
__('Helper');
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\FirstModule\Model;
|
||||
|
||||
class Model
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
__('Model');
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding="utf-8" ?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
|
||||
<layout>
|
||||
<referenceBlock translate="description, label">
|
||||
<description>Module layout description</description>
|
||||
<label>Module layout label</label>
|
||||
<title translate="true">Module layout title</title>
|
||||
</referenceBlock>
|
||||
</layout>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
$.mage.__('Module js');
|
||||
});
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php __('Module template');
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\SecondModule\Model;
|
||||
|
||||
class Model
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
__('Model');
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding="utf-8" ?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
|
||||
<layout>
|
||||
<referenceBlock translate="description, label">
|
||||
<description>Theme layout description</description>
|
||||
<label>Theme layout label</label>
|
||||
<title translate="true">Theme layout title</title>
|
||||
</referenceBlock>
|
||||
</layout>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php __('Theme template');
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
$.mage.__('Lib js')
|
||||
});
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
$.mage.__('Lib js')
|
||||
});
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\FirstModule\Model;
|
||||
|
||||
class Model
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function test()
|
||||
{
|
||||
__('Model unused');
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
$.mage.__('Lib js unused')
|
||||
});
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
?>
|
||||
<?php __('Theme template unused');
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\I18n\Pack;
|
||||
|
||||
use Magento\Framework\Component\ComponentRegistrar;
|
||||
use Magento\Setup\Module\I18n\ServiceLocator;
|
||||
|
||||
class GeneratorTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_testDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_expectedDir;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_dictionaryPath;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_packPath;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_locale;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_expectedFiles;
|
||||
|
||||
/**
|
||||
* @var \Magento\Setup\Module\I18n\Pack\Generator
|
||||
*/
|
||||
protected $_generator;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $backupRegistrar;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->_testDir = realpath(__DIR__ . '/_files');
|
||||
$this->_expectedDir = $this->_testDir . '/expected';
|
||||
$this->_dictionaryPath = $this->_testDir . '/source.csv';
|
||||
$this->_packPath = $this->_testDir . '/pack';
|
||||
$this->_locale = 'de_DE';
|
||||
$this->_expectedFiles = [
|
||||
"/app/code/Magento/FirstModule/i18n/{$this->_locale}.csv",
|
||||
"/app/code/Magento/SecondModule/i18n/{$this->_locale}.csv",
|
||||
"/app/design/adminhtml/default/i18n/{$this->_locale}.csv",
|
||||
];
|
||||
|
||||
$this->_generator = ServiceLocator::getPackGenerator();
|
||||
|
||||
\Magento\Framework\System\Dirs::rm($this->_packPath);
|
||||
|
||||
$reflection = new \ReflectionClass(\Magento\Framework\Component\ComponentRegistrar::class);
|
||||
$paths = $reflection->getProperty('paths');
|
||||
$paths->setAccessible(true);
|
||||
$this->backupRegistrar = $paths->getValue();
|
||||
$paths->setAccessible(false);
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
\Magento\Framework\System\Dirs::rm($this->_packPath);
|
||||
$reflection = new \ReflectionClass(\Magento\Framework\Component\ComponentRegistrar::class);
|
||||
$paths = $reflection->getProperty('paths');
|
||||
$paths->setAccessible(true);
|
||||
$paths->setValue(null, $this->backupRegistrar);
|
||||
$paths->setAccessible(false);
|
||||
}
|
||||
|
||||
public function testGeneration()
|
||||
{
|
||||
$this->assertFileDoesNotExist($this->_packPath);
|
||||
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::MODULE,
|
||||
'Magento_FirstModule',
|
||||
$this->_packPath . '/app/code/Magento/FirstModule'
|
||||
);
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::MODULE,
|
||||
'Magento_SecondModule',
|
||||
$this->_packPath. '/app/code/Magento/SecondModule'
|
||||
);
|
||||
ComponentRegistrar::register(
|
||||
ComponentRegistrar::THEME,
|
||||
'adminhtml/default',
|
||||
$this->_packPath. '/app/design/adminhtml/default'
|
||||
);
|
||||
|
||||
$this->_generator->generate($this->_dictionaryPath, $this->_locale);
|
||||
|
||||
foreach ($this->_expectedFiles as $file) {
|
||||
$this->assertFileEquals($this->_expectedDir . $file, $this->_packPath . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
Helper,Helper
|
||||
Model,Model
|
||||
"Module template","Module template"
|
||||
"Module js","Module js"
|
||||
"Module layout label","Module layout label"
|
||||
"Module layout title","Module layout title"
|
||||
|
+1
@@ -0,0 +1 @@
|
||||
Model,Model
|
||||
|
+3
@@ -0,0 +1,3 @@
|
||||
"Theme template","Theme template"
|
||||
"Theme layout label","Theme layout label"
|
||||
"Theme layout title","Theme layout title"
|
||||
|
+1
@@ -0,0 +1 @@
|
||||
"Lib js","Lib js"
|
||||
|
@@ -0,0 +1,10 @@
|
||||
Helper,Helper,module,Magento_FirstModule
|
||||
Model,Model,module,"Magento_FirstModule,Magento_SecondModule"
|
||||
"Module template","Module template",module,Magento_FirstModule
|
||||
"Theme template","Theme template",theme,adminhtml/default
|
||||
"Module js","Module js",module,Magento_FirstModule
|
||||
"Lib js","Lib js",lib,"lib/web/mage/file.js,lib/web/varien/file.js"
|
||||
"Module layout label","Module layout label",module,Magento_FirstModule
|
||||
"Module layout title","Module layout title",module,Magento_FirstModule
|
||||
"Theme layout label","Theme layout label",theme,adminhtml/default
|
||||
"Theme layout title","Theme layout title",theme,adminhtml/default
|
||||
|
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\I18n\Parser\Adapter;
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\I18n\Parser\Adapter\Js
|
||||
*
|
||||
*/
|
||||
class JsTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var Js
|
||||
*/
|
||||
protected $jsPhraseCollector;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
|
||||
$this->jsPhraseCollector = $objectManager->create(
|
||||
\Magento\Setup\Module\I18n\Parser\Adapter\Js::class
|
||||
);
|
||||
}
|
||||
|
||||
public function testParse()
|
||||
{
|
||||
$file = __DIR__ . '/_files/jsPhrasesForTest.js';
|
||||
$this->jsPhraseCollector->parse($file);
|
||||
$expectation = [
|
||||
[
|
||||
'phrase' => 'text double quote',
|
||||
'file' => $file,
|
||||
'line' => 1,
|
||||
'quote' => '"'
|
||||
],
|
||||
[
|
||||
'phrase' => 'text single quote',
|
||||
'file' => $file,
|
||||
'line' => 2,
|
||||
'quote' => '\''
|
||||
],
|
||||
[
|
||||
'phrase' => 'text "some',
|
||||
'file' => $file,
|
||||
'line' => 3,
|
||||
'quote' => '\''
|
||||
]
|
||||
];
|
||||
$this->assertEquals($expectation, $this->jsPhraseCollector->getPhrases());
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer;
|
||||
|
||||
use Magento\Framework\ObjectManagerInterface;
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\PhraseCollector
|
||||
*/
|
||||
class PhraseCollectorTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var PhraseCollector
|
||||
*/
|
||||
protected $phraseCollector;
|
||||
|
||||
/**
|
||||
* @var ObjectManagerInterface
|
||||
*/
|
||||
protected $objectManager;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->objectManager = Bootstrap::getObjectManager();
|
||||
$this->phraseCollector = $this->objectManager->create(
|
||||
\Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\PhraseCollector::class
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\PhraseCollector::parse
|
||||
*/
|
||||
public function testParse()
|
||||
{
|
||||
$file = __DIR__.'/_files/objectsCode.php.txt';
|
||||
$this->phraseCollector->setIncludeObjects();
|
||||
$this->phraseCollector->parse($file);
|
||||
$expectation = [
|
||||
[
|
||||
'phrase' => '\'Testing\'',
|
||||
'arguments' => 0,
|
||||
'file' => $file,
|
||||
'line' => 3
|
||||
],
|
||||
[
|
||||
'phrase' => '\'More testing\'',
|
||||
'arguments' => 0,
|
||||
'file' => $file,
|
||||
'line' => 4
|
||||
]
|
||||
];
|
||||
$this->assertEquals($expectation, $this->phraseCollector->getPhrases());
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\Translate;
|
||||
|
||||
use Magento\Framework\ObjectManagerInterface;
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\Translate\MethodCollector
|
||||
*/
|
||||
class MethodCollectorTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var MethodCollector
|
||||
*/
|
||||
protected $methodCollector;
|
||||
|
||||
/**
|
||||
* @var ObjectManagerInterface
|
||||
*/
|
||||
protected $objectManager;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->objectManager = Bootstrap::getObjectManager();
|
||||
$this->methodCollector = $this->objectManager->create(
|
||||
\Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\Translate\MethodCollector::class
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\I18n\Parser\Adapter\Php\Tokenizer\Translate\MethodCollector::parse
|
||||
*/
|
||||
public function testParse()
|
||||
{
|
||||
$file = __DIR__.'/../_files/methodsCode.php.txt';
|
||||
$this->methodCollector->parse($file);
|
||||
$expectation = [
|
||||
[
|
||||
'phrase' => '\'Some string\'',
|
||||
'arguments' => 0,
|
||||
'file' => $file,
|
||||
'line' => 4
|
||||
],
|
||||
[
|
||||
'phrase' => '\'One more string\'',
|
||||
'arguments' => 0,
|
||||
'file' => $file,
|
||||
'line' => 5
|
||||
]
|
||||
];
|
||||
$this->assertEquals($expectation, $this->methodCollector->getPhrases());
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$obj1->___toString('Irrelevant string');
|
||||
$obj2->__('Some string');
|
||||
$obj3->__('One more string');
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
new \Magento\Framework\Phrase('Testing');
|
||||
new Phrase('More testing');
|
||||
new \Magento\Framework\DataObject();
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
namespace Magento\Setup\Module\I18n\Parser\Adapter;
|
||||
|
||||
/**
|
||||
* @covers \Magento\Setup\Module\I18n\Parser\Adapter\Xml
|
||||
*
|
||||
*/
|
||||
class XmlTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var Xml
|
||||
*/
|
||||
protected $xmlPhraseCollector;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
|
||||
$this->xmlPhraseCollector = $objectManager->create(
|
||||
\Magento\Setup\Module\I18n\Parser\Adapter\Xml::class
|
||||
);
|
||||
}
|
||||
|
||||
public function testParse()
|
||||
{
|
||||
$file = __DIR__ . '/_files/xmlPhrasesForTest.xml';
|
||||
$this->xmlPhraseCollector->parse($file);
|
||||
$expectation = [
|
||||
[
|
||||
'phrase' => 'Name only',
|
||||
'file' => $file,
|
||||
'line' => '',
|
||||
'quote' => ''
|
||||
],
|
||||
[
|
||||
'phrase' => 'Name and title space delimiter',
|
||||
'file' => $file,
|
||||
'line' => '',
|
||||
'quote' => ''
|
||||
],
|
||||
[
|
||||
'phrase' => 'title1',
|
||||
'file' => $file,
|
||||
'line' => '',
|
||||
'quote' => ''
|
||||
],
|
||||
[
|
||||
'phrase' => 'title2',
|
||||
'file' => $file,
|
||||
'line' => '',
|
||||
'quote' => ''
|
||||
],
|
||||
[
|
||||
'phrase' => 'Name only in sub node',
|
||||
'file' => $file,
|
||||
'line' => '',
|
||||
'quote' => ''
|
||||
],
|
||||
[
|
||||
'phrase' => 'Text outside of attribute',
|
||||
'file' => $file,
|
||||
'line' => '',
|
||||
'quote' => ''
|
||||
]
|
||||
];
|
||||
$this->assertEquals($expectation, $this->xmlPhraseCollector->getPhrases());
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
$t("text double quote");
|
||||
$t('text single quote');
|
||||
$t('text "some');
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<config>
|
||||
<node name="Name only" translate="name"/>
|
||||
<node name="Name and title space delimiter" title="title1" translate="name title"/>
|
||||
<node name="Name and title comma delimiter" title="title2" translate="name, title"/>
|
||||
<node translate="name">
|
||||
<name>Name only in sub node</name>
|
||||
<notName>This shouldn't be picked up</notName>
|
||||
</node>
|
||||
<node translate="true">Text outside of attribute</node>
|
||||
</config>
|
||||
Reference in New Issue
Block a user