@@ -42,9 +42,9 @@ public function setUp()
42
42
/**
43
43
* Test output
44
44
*
45
- * @return voi
45
+ * @return void
46
46
*/
47
- public function testOutput ()
47
+ public function testDefaultOutput ()
48
48
{
49
49
$ data = [
50
50
['Header 1 ' , 'Header ' , 'Long Header ' ],
@@ -54,7 +54,7 @@ public function testOutput()
54
54
$ this ->helper ->output ($ data );
55
55
$ expected = [
56
56
'+--------------+---------------+---------------+ ' ,
57
- '| Header 1 | Header | Long Header | ' ,
57
+ '| <info> Header 1</info> | <info> Header</info> | <info> Long Header</info> | ' ,
58
58
'+--------------+---------------+---------------+ ' ,
59
59
'| short | Longish thing | short | ' ,
60
60
'| Longer thing | short | Longest Value | ' ,
@@ -66,7 +66,7 @@ public function testOutput()
66
66
/**
67
67
* Test output with multibyte characters
68
68
*
69
- * @return voi
69
+ * @return void
70
70
*/
71
71
public function testOutputUtf8 ()
72
72
{
@@ -78,12 +78,132 @@ public function testOutputUtf8()
78
78
$ this ->helper ->output ($ data );
79
79
$ expected = [
80
80
'+--------------+-----------+---------------+ ' ,
81
- '| Header 1 | Head | Long Header | ' ,
81
+ '| <info> Header 1</info> | <info> Head</info> | <info> Long Header</info> | ' ,
82
82
'+--------------+-----------+---------------+ ' ,
83
83
'| short | ÄÄÄÜÜÜ | short | ' ,
84
84
'| Longer thing | longerish | Longest Value | ' ,
85
85
'+--------------+-----------+---------------+ ' ,
86
86
];
87
87
$ this ->assertEquals ($ expected , $ this ->stub ->messages ());
88
88
}
89
+
90
+ /**
91
+ * Test output without headers
92
+ *
93
+ * @return void
94
+ */
95
+ public function testOutputWithoutHeaderStyle ()
96
+ {
97
+ $ data = [
98
+ ['Header 1 ' , 'Header ' , 'Long Header ' ],
99
+ ['short ' , 'Longish thing ' , 'short ' ],
100
+ ['Longer thing ' , 'short ' , 'Longest Value ' ],
101
+ ];
102
+ $ this ->helper ->config (['headerStyle ' => false ]);
103
+ $ this ->helper ->output ($ data );
104
+ $ expected = [
105
+ '+--------------+---------------+---------------+ ' ,
106
+ '| Header 1 | Header | Long Header | ' ,
107
+ '+--------------+---------------+---------------+ ' ,
108
+ '| short | Longish thing | short | ' ,
109
+ '| Longer thing | short | Longest Value | ' ,
110
+ '+--------------+---------------+---------------+ ' ,
111
+ ];
112
+ $ this ->assertEquals ($ expected , $ this ->stub ->messages ());
113
+ }
114
+ /**
115
+ * Test output with different header style
116
+ *
117
+ * @return void
118
+ */
119
+ public function testOutputWithDifferentHeaderStyle ()
120
+ {
121
+ $ data = [
122
+ ['Header 1 ' , 'Header ' , 'Long Header ' ],
123
+ ['short ' , 'Longish thing ' , 'short ' ],
124
+ ['Longer thing ' , 'short ' , 'Longest Value ' ],
125
+ ];
126
+ $ this ->helper ->config (['headerStyle ' => 'error ' ]);
127
+ $ this ->helper ->output ($ data );
128
+ $ expected = [
129
+ '+--------------+---------------+---------------+ ' ,
130
+ '| <error>Header 1</error> | <error>Header</error> | <error>Long Header</error> | ' ,
131
+ '+--------------+---------------+---------------+ ' ,
132
+ '| short | Longish thing | short | ' ,
133
+ '| Longer thing | short | Longest Value | ' ,
134
+ '+--------------+---------------+---------------+ ' ,
135
+ ];
136
+ $ this ->assertEquals ($ expected , $ this ->stub ->messages ());
137
+ }
138
+
139
+ /**
140
+ * Test output without table headers
141
+ *
142
+ * @return void
143
+ */
144
+ public function testOutputWithoutHeaders () {
145
+ $ data = [
146
+ ['short ' , 'Longish thing ' , 'short ' ],
147
+ ['Longer thing ' , 'short ' , 'Longest Value ' ],
148
+ ];
149
+ $ this ->helper ->config (['headers ' => false ]);
150
+ $ this ->helper ->output ($ data );
151
+ $ expected = [
152
+ '+--------------+---------------+---------------+ ' ,
153
+ '| short | Longish thing | short | ' ,
154
+ '| Longer thing | short | Longest Value | ' ,
155
+ '+--------------+---------------+---------------+ ' ,
156
+ ];
157
+ $ this ->assertEquals ($ expected , $ this ->stub ->messages ());
158
+ }
159
+
160
+ /**
161
+ * Test output with row separator
162
+ *
163
+ * @return void
164
+ */
165
+ public function testOutputWithRowSeparator () {
166
+ $ data = [
167
+ ['Header 1 ' , 'Header ' , 'Long Header ' ],
168
+ ['short ' , 'Longish thing ' , 'short ' ],
169
+ ['Longer thing ' , 'short ' , 'Longest Value ' ]
170
+ ];
171
+ $ this ->helper ->config (['rowSeparator ' => true ]);
172
+ $ this ->helper ->output ($ data );
173
+ $ expected = [
174
+ '+--------------+---------------+---------------+ ' ,
175
+ '| <info>Header 1</info> | <info>Header</info> | <info>Long Header</info> | ' ,
176
+ '+--------------+---------------+---------------+ ' ,
177
+ '| short | Longish thing | short | ' ,
178
+ '+--------------+---------------+---------------+ ' ,
179
+ '| Longer thing | short | Longest Value | ' ,
180
+ '+--------------+---------------+---------------+ ' ,
181
+ ];
182
+ $ this ->assertEquals ($ expected , $ this ->stub ->messages ());
183
+ }
184
+
185
+ /**
186
+ * Test output with row separator and no headers
187
+ *
188
+ * @return void
189
+ */
190
+ public function testOutputWithRowSeparatorAndHeaders () {
191
+ $ data = [
192
+ ['Header 1 ' , 'Header ' , 'Long Header ' ],
193
+ ['short ' , 'Longish thing ' , 'short ' ],
194
+ ['Longer thing ' , 'short ' , 'Longest Value ' ],
195
+ ];
196
+ $ this ->helper ->config (['rowSeparator ' => true ]);
197
+ $ this ->helper ->output ($ data );
198
+ $ expected = [
199
+ '+--------------+---------------+---------------+ ' ,
200
+ '| <info>Header 1</info> | <info>Header</info> | <info>Long Header</info> | ' ,
201
+ '+--------------+---------------+---------------+ ' ,
202
+ '| short | Longish thing | short | ' ,
203
+ '+--------------+---------------+---------------+ ' ,
204
+ '| Longer thing | short | Longest Value | ' ,
205
+ '+--------------+---------------+---------------+ ' ,
206
+ ];
207
+ $ this ->assertEquals ($ expected , $ this ->stub ->messages ());
208
+ }
89
209
}
0 commit comments