Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-translation
Test
Unit
App
Config
Type
TranslationTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Translation\Test\Unit\App\Config\Type
;
7
8
use
Magento\Authorizenet\Helper\Backend\Data
;
9
use
Magento\Framework\App\Cache\Type\Translate
;
10
use
Magento\Framework\App\Config\ConfigSourceInterface
;
11
use
Magento\Framework\Cache\FrontendInterface
;
12
use
Magento\Translation\App\Config\Type\Translation
;
13
use
Magento\Framework\DataObject
;
14
18
class
TranslationTest
extends
\PHPUnit\Framework\TestCase
19
{
23
private
$source;
24
28
private
$configType;
29
30
public
function
setUp
()
31
{
32
$this->source = $this->getMockBuilder(ConfigSourceInterface::class)
33
->getMockForAbstractClass();
34
$this->configType =
new
Translation
($this->source);
35
}
36
37
public
function
testGet
()
38
{
39
$path
=
'en_US/default'
;
40
$data
= [
41
'en_US'
=> [
42
'default'
=> [
43
'hello'
=>
'bonjour'
44
]
45
]
46
];
47
48
$this->source->expects($this->once())
49
->method(
'get'
)
50
->with()
51
->willReturn(
$data
);
52
53
$this->assertEquals([
'hello'
=>
'bonjour'
], $this->configType->get(
$path
));
54
}
55
}
Magento\Translation\App\Config\Type\Translation
Definition:
Translation.php:15
Magento\Translation\Test\Unit\App\Config\Type\TranslationTest\testGet
testGet()
Definition:
TranslationTest.php:37
Magento\Framework\Cache\FrontendInterface
Definition:
FrontendInterface.php:14
Magento\Framework\App\Config\ConfigSourceInterface
Definition:
ConfigSourceInterface.php:13
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Translation\Test\Unit\App\Config\Type\TranslationTest
Definition:
TranslationTest.php:18
Magento\Authorizenet\Helper\Backend\Data
Definition:
Data.php:20
Magento\Translation\Test\Unit\App\Config\Type
Definition:
TranslationTest.php:6
Magento\Framework\App\Cache\Type\Translate
Definition:
Translate.php:11
$path
$path
Definition:
import_with_filesystem_images.php:14
Magento\Translation\Test\Unit\App\Config\Type\TranslationTest\setUp
setUp()
Definition:
TranslationTest.php:30
Magento\Framework\DataObject
Definition:
Cache.php:6