mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
1dc0675abf
commit
567143b3ff
@ -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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user