public function testLabelIdIsCorrect() { $form = new \Zend\Form\Form(); $form->setElementsBelongTo('comment'); $this->element->setLabel("My Captcha"); $form->addElement($this->element); $html = $form->render($this->getView()); $expect = sprintf('for="comment-%s-input"', $this->element->getName()); $this->assertRegexp("/<label [^>]*?{$expect}/", $html, $html); }