MINOR: Fixed TableListField test to suit changed behaviour. (from r96639) (from r98141)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102613 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 02:17:51 +00:00
parent 99be47c479
commit 1e78fbc34c

View File

@ -137,11 +137,11 @@ class TableListFieldTest extends SapphireTest {
$ajaxResponse = Director::test($table->Link())->getBody();
// Check that the column headings have been rendered
$this->assertRegExp('/<th[^>]*>\s*Col A\s*<\/th>/', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>\s*Col B\s*<\/th>/', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>\s*Col C\s*<\/th>/', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>\s*Col D\s*<\/th>/', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>\s*Col E\s*<\/th>/', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>.*Col A.*<\/th>/si', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>.*Col B.*<\/th>/si', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>.*Col C.*<\/th>/si', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>.*Col D.*<\/th>/si', $ajaxResponse);
$this->assertRegExp('/<th[^>]*>.*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);