示例#1
0
    /**
     * Test id selection within nested elements.
     */
    public function testFindById3()
    {
        $form = new HtmlFormTag();
        $form->setParentObject(new Document());
        $form->setContent('<form:text name="bar" />
<form:group>
   <form:group>
      <form:text id="foo" name="foo" value="123" />
   </form:group>
</form:group>
<form:button name="submit" value="submit" />');
        $form->onParseTime();
        $form->onAfterAppend();
        $actual = $form->getFormElementByID('foo');
        $this->assertNotNull($actual);
        $this->assertInstanceOf(TextFieldTag::class, $actual);
        $this->assertEquals('123', $actual->getAttribute('value'));
    }