Permalink
Browse files

MINOR Fixed TableListFieldTest->testSelectOptionsRendering() (from r1…

…05297)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112495 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 2943c75 commit 1dc0675abf3789246efc4102672e247638ee8e81 @chillu chillu committed Oct 15, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 tests/forms/TableListFieldTest.php
@@ -140,6 +140,9 @@ function testSelectOptionsAddRemove() {
}
function testSelectOptionsRendering() {
+ $obj1 = $this->objFromFixture('TableListFieldTest_Obj', 'one');
+ $obj2 = $this->objFromFixture('TableListFieldTest_Obj', 'two');
+ $obj3 = $this->objFromFixture('TableListFieldTest_Obj', 'three');
$table = new TableListField("Tester", "TableListFieldTest_Obj", array(
"A" => "Col A",
));
@@ -149,9 +152,9 @@ function testSelectOptionsRendering() {
$tableHTML = $table->FieldHolder();
$this->assertContains('rel="F"', $tableHTML);
- $this->assertRegExp('/<tr[^>]*id="record-Tester-1"[^>]*>[^<]*<td[^>]*class="markingcheckbox F"[^>]*>/si', $tableHTML);
- $this->assertRegExp('/<tr[^>]*id="record-Tester-2"[^>]*>[^<]*<td[^>]*class="markingcheckbox"[^>]*>/si', $tableHTML);
- $this->assertRegExp('/<tr[^>]*id="record-Tester-3"[^>]*>[^<]*<td[^>]*class="markingcheckbox F"[^>]*>/si', $tableHTML);
+ $this->assertRegExp('/<tr[^>]*id="record-Tester-' . $obj1->ID . '"[^>]*>[^<]*<td[^>]*class="markingcheckbox F"[^>]*>/si', $tableHTML);
+ $this->assertRegExp('/<tr[^>]*id="record-Tester-' . $obj1->ID . '"[^>]*>[^<]*<td[^>]*class="markingcheckbox"[^>]*>/si', $tableHTML);
+ $this->assertRegExp('/<tr[^>]*id="record-Tester-' . $obj3->ID . '"[^>]*>[^<]*<td[^>]*class="markingcheckbox F"[^>]*>/si', $tableHTML);
}
/**

0 comments on commit 1dc0675

Please sign in to comment.