Exemplo n.º 1
0
 /**
  * @testdox Configures itself in the init() method.
  */
 public function testInitialization()
 {
     $this->target->expects($this->once())->method('setAttribute')->with('id', 'jobcompanyname-fieldset');
     $this->target->expects($this->once())->method('setName')->with('jobCompanyName');
     $addParam = array('type' => 'Jobs/HiringOrganizationSelect', 'property' => true, 'name' => 'companyId', 'options' => array('label' => 'Companyname'), 'attributes' => array('data-placeholder' => 'Select hiring organization', 'data-allowclear' => 'false'));
     $this->target->expects($this->once())->method('add')->with($addParam);
     $this->target->init();
 }
Exemplo n.º 2
0
 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  *
  * @return CompanyNameFieldset
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     /** @var FormElementManager $serviceLocator */
     $serviceLocator = $serviceLocator->getServiceLocator();
     /**
      * @var $hydrator OrganizationNameHydrator
      */
     $hydrator = $serviceLocator->get('Jobs\\Form\\Hydrator\\OrganizationNameHydrator');
     $form = new CompanyNameFieldset();
     $form->setHydrator($hydrator);
     return $form;
 }