public function testSimpleFormPassInRenderer() { $f = $this->createForm('/post/url', 'get'); $row = new TextRow('foo'); $f->addRow($row); $expected = Html::openTag('form', array('action' => '/post/url', 'method' => 'GET')); $this->renderer->expects($this->never())->method('row'); $renderer = $this->getMock('Reform\\Form\\Renderer\\RendererInterface'); $renderer->expects($this->once())->method('row')->with($row)->will($this->returnValue('row')); $expected .= 'row'; $expected .= '</form>'; $this->assertSame($expected, $f->render($renderer)); }
public function testOpenTag() { $this->assertSame('<p>', Html::openTag('p')); $this->assertSame('<p class="text">', Html::openTag('p', array('class' => 'text'))); $this->assertSame('<p class="text" id="paragraph5">', Html::openTag('p', array('class' => 'text', 'id' => 'paragraph5'))); }
/** * Render the header of this Form as Html. */ public function header() { $attributes = array('action' => $this->action, 'method' => $this->method); $attributes = array_merge($attributes, $this->attributes); return Html::openTag('form', $attributes); }