public function testAddValidElements()
 {
     $elements = new TextSearchFormFieldset();
     $this->target->add($elements, ['name' => 'elements']);
     $actual = $this->target->get('elements');
     $this->assertSame($elements, $actual);
 }
 /**
  * @dataProvider buttonValuesProvider()
  *
  * @param       $label
  * @param       $priority
  * @param       $type
  * @param array $expect
  */
 public function testAddButton($label, $priority, $type, $expect = [])
 {
     $expectWith = ['type' => 'Button', 'name' => $expect['name'], 'options' => ['label' => $expect['label']], 'attributes' => ['class' => 'btn btn-' . $expect['class'], 'type' => $type]];
     $this->target->expects($this->once())->method('add')->with($expectWith, ['priority' => $priority]);
     $this->target->addButton($label, $priority, $type);
 }
Example #3
0
 public function init()
 {
     parent::init();
     $this->add(array('type' => 'Jobs/StatusSelect', 'options' => ['include_all_option' => true], 'attributes' => array('value' => 'all')));
     $this->add(array('type' => 'Jobs/ActiveOrganizationSelect', 'property' => true, 'name' => 'companyId', 'options' => array('label' => 'Companyname'), 'attributes' => array('data-placeholder' => 'Select hiring organization', 'class' => 'form-control')));
 }