示例#1
0
 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));
 }
示例#2
0
 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')));
 }
示例#3
0
 /**
  * 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);
 }