diff --git a/tests/forms/TableListFieldTest.php b/tests/forms/TableListFieldTest.php
index 13d2c4d48..1a024f222 100755
--- a/tests/forms/TableListFieldTest.php
+++ b/tests/forms/TableListFieldTest.php
@@ -137,11 +137,11 @@ class TableListFieldTest extends SapphireTest {
$ajaxResponse = Director::test($table->Link())->getBody();
// Check that the column headings have been rendered
- $this->assertRegExp('/
]*>\s*Col A\s*<\/th>/', $ajaxResponse);
- $this->assertRegExp('/ | ]*>\s*Col B\s*<\/th>/', $ajaxResponse);
- $this->assertRegExp('/ | ]*>\s*Col C\s*<\/th>/', $ajaxResponse);
- $this->assertRegExp('/ | ]*>\s*Col D\s*<\/th>/', $ajaxResponse);
- $this->assertRegExp('/ | ]*>\s*Col E\s*<\/th>/', $ajaxResponse);
+ $this->assertRegExp('/ | ]*>.*Col A.*<\/th>/si', $ajaxResponse);
+ $this->assertRegExp('/ | ]*>.*Col B.*<\/th>/si', $ajaxResponse);
+ $this->assertRegExp('/ | ]*>.*Col C.*<\/th>/si', $ajaxResponse);
+ $this->assertRegExp('/ | ]*>.*Col D.*<\/th>/si', $ajaxResponse);
+ $this->assertRegExp('/ | ]*>.*Col E.*<\/th>/si', $ajaxResponse);
}
function testCsvExport() {
@@ -173,10 +173,11 @@ class TableListFieldTest extends SapphireTest {
array('Col A', 'Col B')
);
- $csvRow = fgetcsv($csvFile);
+ // fgetcsv doesn't handle escaped quotes in the string in PHP 5.2, so we're asserting the
+ // raw string instead.
$this->assertEquals(
- $csvRow,
- array('"A field, with a comma"', 'A second field')
+ '"\"A field, with a comma\"","A second field"',
+ trim(fgets($csvFile))
);
fclose($csvFile);
|