Browse files

MINOR Making SecurityAdminTest more resilient against markup order ch…

…anges
  • Loading branch information...
1 parent 1eaf45a commit 0dab75c3a0201e661e3510281dddd422d38b0e81 @chillu chillu committed Dec 22, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 admin/tests/SecurityAdminTest.php
View
10 admin/tests/SecurityAdminTest.php
@@ -13,8 +13,10 @@ function testGroupExport() {
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
/* First, open the applicable group */
- $this->get('admin/security/show/' . $this->idFromFixture('Group','admin'));
- $this->assertRegExp('/<input[^>]+id="Form_EditForm_Title"[^>]+value="Administrators"[^>]*>/',$this->content());
+ $response = $this->get('admin/security/show/' . $this->idFromFixture('Group','admin'));
+ $inputs = $this->cssParser()->getBySelector('input#Form_EditForm_Title');
+ $this->assertNotNull($inputs);
+ $this->assertEquals('Administrators', (string)$inputs[0]['value']);
/* Then load the export page */
$this->get('admin/security/EditForm/field/Members/export');
@@ -29,7 +31,9 @@ function testEmptyGroupExport() {
/* First, open the applicable group */
$this->get('admin/security/show/' . $this->idFromFixture('Group','empty'));
- $this->assertRegExp('/<input[^>]+id="Form_EditForm_Title"[^>]+value="Empty Group"[^>]*>/',$this->content());
+ $inputs = $this->cssParser()->getBySelector('input#Form_EditForm_Title');
+ $this->assertNotNull($inputs);
+ $this->assertEquals('Empty Group', (string)$inputs[0]['value']);
/* Then load the export page */
$this->get('admin/security/EditForm/field/Members/export');

0 comments on commit 0dab75c

Please sign in to comment.