ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
@@ -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($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);
}
}
}
@@ -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 Helper Helper
2 Model Model
3 Module template Module template
4 Module js Module js
5 Module layout label Module layout label
6 Module layout title Module layout title
@@ -0,0 +1,3 @@
"Theme template","Theme template"
"Theme layout label","Theme layout label"
"Theme layout title","Theme layout title"
1 Theme template Theme template
2 Theme layout label Theme layout label
3 Theme layout title Theme layout title
@@ -0,0 +1 @@
"Lib js","Lib js"
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
1 Helper Helper module Magento_FirstModule
2 Model Model module Magento_FirstModule,Magento_SecondModule
3 Module template Module template module Magento_FirstModule
4 Theme template Theme template theme adminhtml/default
5 Module js Module js module Magento_FirstModule
6 Lib js Lib js lib lib/web/mage/file.js,lib/web/varien/file.js
7 Module layout label Module layout label module Magento_FirstModule
8 Module layout title Module layout title module Magento_FirstModule
9 Theme layout label Theme layout label theme adminhtml/default
10 Theme layout title Theme layout title theme adminhtml/default