MINOR More solid markup testing in TableListFieldTest through xpath (from r105305)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112496 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-15 02:48:27 +00:00
parent 1dc0675abf
commit 567143b3ff

View File

@ -150,11 +150,13 @@ class TableListFieldTest extends SapphireTest {
$table->addSelectOptions(array("F"=>"FieldF")); $table->addSelectOptions(array("F"=>"FieldF"));
$tableHTML = $table->FieldHolder(); $tableHTML = $table->FieldHolder();
$this->assertContains('rel="F"', $tableHTML);
$this->assertRegExp('/<tr[^>]*id="record-Tester-' . $obj1->ID . '"[^>]*>[^<]*<td[^>]*class="markingcheckbox F"[^>]*>/si', $tableHTML); $p = new CSSContentParser($tableHTML);
$this->assertRegExp('/<tr[^>]*id="record-Tester-' . $obj1->ID . '"[^>]*>[^<]*<td[^>]*class="markingcheckbox"[^>]*>/si', $tableHTML); $this->assertContains('rel="F"', $tableHTML);
$this->assertRegExp('/<tr[^>]*id="record-Tester-' . $obj3->ID . '"[^>]*>[^<]*<td[^>]*class="markingcheckbox F"[^>]*>/si', $tableHTML); $tbody = $p->getByXpath('//tbody');
$this->assertContains('markingcheckbox F', (string)$tbody[0]->tr[0]->td[0]['class']);
$this->assertContains('markingcheckbox', (string)$tbody[0]->tr[1]->td[0]['class']);
$this->assertContains('markingcheckbox F', (string)$tbody[0]->tr[2]->td[0]['class']);
} }
/** /**