diff options
author | Guy Brand <gb@unistra.fr> | 2015-08-23 15:54:03 +0200 |
---|---|---|
committer | Guy Brand <gb@unistra.fr> | 2015-08-23 15:54:03 +0200 |
commit | d1c5a21205ecdf83c4cbdcd9245556121688e798 (patch) | |
tree | f99aacf8e4e2aad00b106d9b905a14c3536ba935 /_test/tests/inc/form/inputelement.test.php | |
parent | 2beabe635c6b98fcf412ba42d137a5de33543109 (diff) | |
parent | 0f0d29909c63f9897c9c003e6d3e3b8381a6f36d (diff) | |
download | rpg-d1c5a21205ecdf83c4cbdcd9245556121688e798.tar.gz rpg-d1c5a21205ecdf83c4cbdcd9245556121688e798.tar.bz2 |
Merge branch 'master' into stable
Diffstat (limited to '_test/tests/inc/form/inputelement.test.php')
-rw-r--r-- | _test/tests/inc/form/inputelement.test.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/_test/tests/inc/form/inputelement.test.php b/_test/tests/inc/form/inputelement.test.php index 7a5e6d2ea..3257d2a89 100644 --- a/_test/tests/inc/form/inputelement.test.php +++ b/_test/tests/inc/form/inputelement.test.php @@ -14,6 +14,7 @@ class form_inputelement_test extends DokuWikiTest { $input = $pq->find('input[name=foo]'); $this->assertTrue($input->length == 1); $this->assertEquals('this is text', $input->val()); + $this->assertEquals('text', $input->attr('type')); $label = $pq->find('label'); $this->assertTrue($label->length == 1); @@ -38,4 +39,20 @@ class form_inputelement_test extends DokuWikiTest { $this->assertEquals('a new text', $input->val()); } + function test_password() { + $form = new Form\Form(); + $form->addPasswordInput('foo', 'label text')->val('this is text'); + + $html = $form->toHTML(); + $pq = phpQuery::newDocumentXHTML($html); + + $input = $pq->find('input[name=foo]'); + $this->assertTrue($input->length == 1); + $this->assertEquals('this is text', $input->val()); + $this->assertEquals('password', $input->attr('type')); + + $label = $pq->find('label'); + $this->assertTrue($label->length == 1); + $this->assertEquals('label text', $label->find('span')->text()); + } } |