예제 #1
0
 public function testRenderAppendsRequiredClassToClassProvidedInRequiredElement()
 {
     $element = new Element('foo');
     $element->setRequired(true)
             ->setView($this->getView())
             ->setLabel('My Label')
             ->setAttrib('class', 'bazbat');
     $this->decorator->setElement($element);
     $content = 'test content';
     $test = $this->decorator->render($content);
     $this->assertRegexp('/<label[^>]*?class="[^"]*required/', $test, $test);
     $this->assertNotRegexp('/<label[^>]*?class="[^"]*bazbat/', $test, $test);
 }