コード例 #1
0
ファイル: ButtonTest.php プロジェクト: rezix/ZfcDatagrid
 public function testLabel()
 {
     $button = new Button();
     $button->setLabel('My label');
     $this->assertEquals('My label', $button->getLabel());
     $html = '<a href="#" class="btn">My label</a>';
     $this->assertEquals($html, $button->toHtml([]));
 }
コード例 #2
0
ファイル: ButtonTest.php プロジェクト: DAICAR/ZfcDatagrid
 public function testColumnLabelAndToHtml()
 {
     $col = $this->getMockForAbstractClass('ZfcDatagrid\\Column\\AbstractColumn');
     $col->setUniqueId('myCol');
     $button = new Button();
     $button->setLabel($col);
     $this->assertInstanceOf('ZfcDatagrid\\Column\\AbstractColumn', $button->getLabel());
     $html = '<a href="#" class="btn btn-default">Blubb</a>';
     $this->assertEquals($html, $button->toHtml(['myCol' => 'Blubb']));
 }