File tree 1 file changed +57
-0
lines changed
dev/tests/integration/testsuite/Magento/Config/Model/Config/Backend 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Config \Model \Config \Backend ;
7
+
8
+ use Magento \TestFramework \Helper \Bootstrap ;
9
+
10
+ class FileTest extends \PHPUnit \Framework \TestCase
11
+ {
12
+ /**
13
+ * @var \Magento\Config\Model\Config\Backend\File
14
+ */
15
+ private $ _model = null ;
16
+
17
+ protected function setUp ()
18
+ {
19
+ parent ::setUp ();
20
+ $ this ->_model = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
21
+ \Magento \Config \Model \Config \Backend \File::class
22
+ );
23
+ }
24
+
25
+ /**
26
+ * @magentoDbIsolation disabled
27
+ * @magentoAppArea adminhtml
28
+ */
29
+ public function testFileSave ()
30
+ {
31
+ $ groups = [
32
+ 'identity ' => [
33
+ 'fields ' => [
34
+ 'logo ' => [
35
+ 'value ' => [
36
+ 'value ' => 'example.png '
37
+ ],
38
+ ],
39
+ ],
40
+ ],
41
+ ];
42
+ $ expected = [
43
+ 'sales/identity/logo ' => 'example.png '
44
+ ];
45
+ $ section = 'sales ' ;
46
+ $ objectManager = Bootstrap::getObjectManager ();
47
+
48
+ /** @var $_configDataObject \Magento\Config\Model\Config */
49
+ $ _configDataObject = $ objectManager ->create (\Magento \Config \Model \Config::class);
50
+ $ _configDataObject ->setSection ($ section )->setWebsite ('base ' )->setGroups ($ groups )->save ();
51
+
52
+ $ _configDataObject = $ objectManager ->create (\Magento \Config \Model \Config::class);
53
+ $ _configData = $ _configDataObject ->setSection ('sales/identity ' )->setWebsite ('base ' )->load ();
54
+
55
+ $ this ->assertEquals ($ expected , $ _configData );
56
+ }
57
+ }
You can’t perform that action at this time.
0 commit comments