/** * Tests resetInput with displayTo * * @author Nikolaos Dimopoulos <*****@*****.**> * @since 2014-09-05 */ public function testResetInputWithDisplayTo() { $this->specify("resetInput with displayTo returns invalid HTML Strict", function () { PhTTag::setDoctype(PhTTag::XHTML10_STRICT); $options = 'x_name'; $expected = '<input type="text" id="x_name" name="x_name" ' . 'value="x_other" />'; PhTTag::displayTo('x_name', 'x_other'); $actual = PhTTag::textField($options); PhTTag::resetInput(); expect($actual)->equals($expected); $expected = '<input type="text" id="x_name" name="x_name" />'; $actual = PhTTag::textField($options); expect($actual)->equals($expected); }); $this->specify("resetInput with displayTo returns invalid HTML XHTML", function () { PhTTag::setDoctype(PhTTag::HTML5); $options = 'x_name'; $expected = '<input type="text" id="x_name" name="x_name" ' . 'value="x_other">'; PhTTag::displayTo('x_name', 'x_other'); $actual = PhTTag::textField($options); PhTTag::resetInput(); expect($actual)->equals($expected); $expected = '<input type="text" id="x_name" name="x_name">'; $actual = PhTTag::textField($options); expect($actual)->equals($expected); }); }