Skip to content

Commit eded85f

Browse files
committed
Merge branch '2.4'
* 2.4: (44 commits) [FrameworkBundle] Add missing license headers Fix parent serialization of user object [DependencyInjection] fixed typo added condition to avoid skipping tests on JSON_PRETTY support add memcache, memcached, and mongodb extensions to run skipped tests [DependencyInjection] Fixed support for backslashes in service ids. fix #9356 [Security] Logger should manipulate the user reloaded from provider [FrameworkBundle] Added extra details in XMLDescriptor to improve container description fixed CS Crawler default namespace fix [BrowserKit] fixes #8311 CookieJar is totally ignorant of RFC 6265 edge cases [HttpFoundation] fixed constants that do exist in 2.3 (only in 2.4) fix 5528 let ArrayNode::normalizeValue respect order of value array provided fix #7243 allow 0 as arraynode name Fixed issue in BaseDateTimeTransformer when invalid timezone cause Transformation filed exception (closes #9403). BinaryFileResponse should also return 416 or 200 on some range-requets fix deprecated usage and clarify constructor defaults for number formatter Bumping dependency to ProxyManager to allow testing against the new 0.5.x branch changes Do normalization on tag options bumped Symfony version to 2.3.9 ...
2 parents b44aa6a + b9f8146 commit eded85f

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

Helper/TableHelper.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,29 @@ public function addRow(array $row)
161161
{
162162
$this->rows[] = array_values($row);
163163

164+
$keys = array_keys($this->rows);
165+
$rowKey = array_pop($keys);
166+
167+
foreach ($row as $key => $cellValue) {
168+
if (!strstr($cellValue, "\n")) {
169+
continue;
170+
}
171+
172+
$lines = explode("\n", $cellValue);
173+
$this->rows[$rowKey][$key] = $lines[0];
174+
unset($lines[0]);
175+
176+
foreach ($lines as $lineKey => $line) {
177+
$nextRowKey = $rowKey + $lineKey + 1;
178+
179+
if (isset($this->rows[$nextRowKey])) {
180+
$this->rows[$nextRowKey][$key] = $line;
181+
} else {
182+
$this->rows[$nextRowKey] = array($key => $line);
183+
}
184+
}
185+
}
186+
164187
return $this;
165188
}
166189

Tests/Helper/TableHelperTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,31 @@ public function testRenderProvider()
172172
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
173173
+---------------+--------------------------+------------------+
174174
175+
TABLE
176+
),
177+
array(
178+
array('ISBN', 'Title', 'Author'),
179+
array(
180+
array("99921-58-10-7", "Divine\nComedy", "Dante Alighieri"),
181+
array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
182+
array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
183+
array("960-425-059-0", "The Lord of the Rings", "J. R. R.\nTolkien"),
184+
),
185+
TableHelper::LAYOUT_DEFAULT,
186+
<<<TABLE
187+
+---------------+----------------------------+-----------------+
188+
| ISBN | Title | Author |
189+
+---------------+----------------------------+-----------------+
190+
| 99921-58-10-7 | Divine | Dante Alighieri |
191+
| | Comedy | |
192+
| 9971-5-0210-2 | Harry Potter | Rowling |
193+
| | and the Chamber of Secrets | Joanne K. |
194+
| 9971-5-0210-2 | Harry Potter | Rowling |
195+
| | and the Chamber of Secrets | Joanne K. |
196+
| 960-425-059-0 | The Lord of the Rings | J. R. R. |
197+
| | | Tolkien |
198+
+---------------+----------------------------+-----------------+
199+
175200
TABLE
176201
),
177202
array(

0 commit comments

Comments
 (0)