Example #1
0
    /**
     * Test id selection within nested elements.
     */
    public function testGetLabel3()
    {
        $form = new HtmlFormTag();
        $form->setParentObject(new Document());
        $form->setContent('<form:text name="bar" />
<form:group>
   <form:label name="bar">Other Label</form:label>
   <form:group>
      <form:label name="foo">Label</form:label>
      <html:getstring
               name="foo"
               namespace="APF\\modules\\usermanagement\\pres"
               config="labels.ini"
               entry="frontend.proxy.add-users-to-proxy.intro.text"/>
   </form:group>
</form:group>
<form:button name="submit" value="submit" />');
        $form->onParseTime();
        $form->onAfterAppend();
        $actual = $form->getLabel('foo');
        $this->assertNotNull($actual);
        $this->assertInstanceOf(LanguageLabel::class, $actual);
        $this->assertEquals('labels.ini', $actual->getAttribute('config'));
    }