33 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6-
76namespace Magento \Framework \App \Test \Unit \DeploymentConfig \Writer ;
87
9- use \ Magento \Framework \App \DeploymentConfig \Writer \PhpFormatter ;
8+ use Magento \Framework \App \DeploymentConfig \Writer \PhpFormatter ;
109
1110class PhpFormatterTest extends \PHPUnit_Framework_TestCase
1211{
1312 /**
1413 * @dataProvider formatWithCommentDataProvider
15- * @param string|array $data
16- * @param array $comments
14+ * @param string[] $data
15+ * @param string[] $comments
1716 * @param string $expectedResult
1817 */
1918 public function testFormat ($ data , $ comments , $ expectedResult )
@@ -22,6 +21,9 @@ public function testFormat($data, $comments, $expectedResult)
2221 $ this ->assertEquals ($ expectedResult , $ formatter ->format ($ data , $ comments ));
2322 }
2423
24+ /**
25+ * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
26+ */
2527 public function formatWithCommentDataProvider ()
2628 {
2729 $ array = [
@@ -45,9 +47,9 @@ public function formatWithCommentDataProvider()
4547 ];
4648 $ comments1 = ['ns2 ' => 'comment for namespace 2 ' ];
4749 $ 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 ' ,
5153 'ns4 ' => 'comment for namespace 4 ' ,
5254 'ns5 ' => 'comment for unexisted namespace 5 ' ,
5355 ];
@@ -68,7 +70,8 @@ public function formatWithCommentDataProvider()
6870 ),
6971 ),
7072 /**
71- * 'comment for namespace 2'
73+ * For the section: ns2
74+ * comment for namespace 2
7275 */
7376 'ns2' =>
7477 array (
@@ -78,15 +81,16 @@ public function formatWithCommentDataProvider()
7881 ),
7982 ),
8083 'ns3' => 'just text',
81- 'ns4' => 'just text'
84+ 'ns4' => 'just text',
8285);
8386
8487TEXT ;
8588 $ expectedResult2 = <<<TEXT
8689<?php
8790return array (
8891 /**
89- * 'comment for namespace 1'
92+ * For the section: ns1
93+ * comment for' namespace 1
9094 */
9195 'ns1' =>
9296 array (
@@ -102,8 +106,9 @@ public function formatWithCommentDataProvider()
102106 ),
103107 ),
104108 /**
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
107112 */
108113 'ns2' =>
109114 array (
@@ -113,13 +118,15 @@ public function formatWithCommentDataProvider()
113118 ),
114119 ),
115120 /**
116- * 'comment for namespace 3'
121+ * For the section: ns3
122+ * comment for" namespace 3
117123 */
118124 'ns3' => 'just text',
119125 /**
120- * 'comment for namespace 4'
126+ * For the section: ns4
127+ * comment for namespace 4
121128 */
122- 'ns4' => 'just text'
129+ 'ns4' => 'just text',
123130);
124131
125132TEXT ;
0 commit comments