/** * Unit Test case-9 to test Check Boxes */ public function testAdminCheckbox() { $test = new Field(6); $test->setType("checkbox"); $test->setIsRequired(true); $test->setTextBefore("CHECK BOX!"); $test->setOptions("option1|-etm-|option2|-etm-|option3"); $html = $test->getAdminHtml(); /** * test to see the textbeforechanges */ preg_match_all('/CHECK BOX!/', $html, $matches); $this->assertEquals(2, count($matches[0])); /** * test to see we see the id 6 */ preg_match_all('/etm_element_(\\d+)/', $html, $matches); $this->assertEquals(6, $matches[1][0]); /** * test to see we see input types of type select */ preg_match_all('/<input type=\'checkbox\'/', $html, $matches); $this->assertEquals(3, count($matches[0])); }