template = new Template(); } /** * Test for checkbox.phtml * * @return void */ public function testGetCheckbox() { $name = "test_display_html_checkbox"; $label = "text_label_for_checkbox"; // assertXmlStringEqualsXmlString require both inputs to be a valid xml string // dummy tag will make input a valid xml string $this->assertXmlStringEqualsXmlString( ' ' . $this->template->render('checkbox', [ 'html_field_name' => $name, 'label' => $label, 'checked' => false, 'onclick' => false, 'html_field_id' => $name, ]) . ' ', ' ' ); } /** * Test for checkbox.phtml * * @return void */ public function testGetCheckboxChecked() { $name = "test_display_html_checkbox"; $label = "text_label_for_checkbox"; $this->assertXmlStringEqualsXmlString( '' . $this->template->render('checkbox', [ 'html_field_name' => $name, 'label' => $label, 'checked' => true, 'onclick' => false, 'html_field_id' => $name, ]) . '', ' ' ); } /** * Test for checkbox.phtml * * @return void */ public function testGetCheckboxOnclick() { $name = "test_display_html_checkbox"; $label = "text_label_for_checkbox"; $this->assertXmlStringEqualsXmlString( '' . $this->template->render('checkbox', [ 'html_field_name' => $name, 'label' => $label, 'checked' => false, 'onclick' => true, 'html_field_id' => $name, ]) . '', ' ' ); } /** * Test for checkbox.phtml * * @return void */ public function testGetCheckboxCheckedOnclick() { $name = "test_display_html_checkbox"; $label = "text_label_for_checkbox"; $this->assertXmlStringEqualsXmlString( '' . $this->template->render('checkbox', [ 'html_field_name' => $name, 'label' => $label, 'checked' => true, 'onclick' => true, 'html_field_id' => $name, ]) . '', ' ' ); } }