3
3
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
namespace Magento \Framework \App \Test \Unit \DeploymentConfig \Writer ;
8
7
9
- use \ Magento \Framework \App \DeploymentConfig \Writer \PhpFormatter ;
8
+ use Magento \Framework \App \DeploymentConfig \Writer \PhpFormatter ;
10
9
11
10
class PhpFormatterTest extends \PHPUnit_Framework_TestCase
12
11
{
13
12
/**
14
13
* @dataProvider formatWithCommentDataProvider
15
- * @param string|array $data
16
- * @param array $comments
14
+ * @param string[] $data
15
+ * @param string[] $comments
17
16
* @param string $expectedResult
18
17
*/
19
18
public function testFormat ($ data , $ comments , $ expectedResult )
@@ -22,6 +21,9 @@ public function testFormat($data, $comments, $expectedResult)
22
21
$ this ->assertEquals ($ expectedResult , $ formatter ->format ($ data , $ comments ));
23
22
}
24
23
24
+ /**
25
+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
26
+ */
25
27
public function formatWithCommentDataProvider ()
26
28
{
27
29
$ array = [
@@ -45,9 +47,9 @@ public function formatWithCommentDataProvider()
45
47
];
46
48
$ comments1 = ['ns2 ' => 'comment for namespace 2 ' ];
47
49
$ comments2 = [
48
- 'ns1 ' => 'comment for namespace 1 ' ,
49
- 'ns2 ' => "comment for namespace 2. \nNext comment for namespace 2 " ,
50
- 'ns3 ' => 'comment for namespace 3 ' ,
50
+ 'ns1 ' => 'comment for \' namespace 1 ' ,
51
+ 'ns2 ' => "comment for namespace 2. \nNext comment for' namespace 2 " ,
52
+ 'ns3 ' => 'comment for" namespace 3 ' ,
51
53
'ns4 ' => 'comment for namespace 4 ' ,
52
54
'ns5 ' => 'comment for unexisted namespace 5 ' ,
53
55
];
@@ -68,7 +70,8 @@ public function formatWithCommentDataProvider()
68
70
),
69
71
),
70
72
/**
71
- * 'comment for namespace 2'
73
+ * For the section: ns2
74
+ * comment for namespace 2
72
75
*/
73
76
'ns2' =>
74
77
array (
@@ -78,15 +81,16 @@ public function formatWithCommentDataProvider()
78
81
),
79
82
),
80
83
'ns3' => 'just text',
81
- 'ns4' => 'just text'
84
+ 'ns4' => 'just text',
82
85
);
83
86
84
87
TEXT ;
85
88
$ expectedResult2 = <<<TEXT
86
89
<?php
87
90
return array (
88
91
/**
89
- * 'comment for namespace 1'
92
+ * For the section: ns1
93
+ * comment for' namespace 1
90
94
*/
91
95
'ns1' =>
92
96
array (
@@ -102,8 +106,9 @@ public function formatWithCommentDataProvider()
102
106
),
103
107
),
104
108
/**
105
- * 'comment for namespace 2.
106
- * Next comment for namespace 2'
109
+ * For the section: ns2
110
+ * comment for namespace 2.
111
+ * Next comment for' namespace 2
107
112
*/
108
113
'ns2' =>
109
114
array (
@@ -113,13 +118,15 @@ public function formatWithCommentDataProvider()
113
118
),
114
119
),
115
120
/**
116
- * 'comment for namespace 3'
121
+ * For the section: ns3
122
+ * comment for" namespace 3
117
123
*/
118
124
'ns3' => 'just text',
119
125
/**
120
- * 'comment for namespace 4'
126
+ * For the section: ns4
127
+ * comment for namespace 4
121
128
*/
122
- 'ns4' => 'just text'
129
+ 'ns4' => 'just text',
123
130
);
124
131
125
132
TEXT ;
0 commit comments