Example #1
0
 public function __construct(Values $values, User $user)
 {
     $this->user = $user;
     parent::__construct(strtolower(str_replace('\\', '-', get_class($this))));
     $this->setAttribute('method', 'post');
     $this->add(array('name' => 'name', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Nafn...', 'required' => 'required'), 'options' => array('label' => 'Nafn')));
     $this->add(array('name' => 'email', 'type' => 'Zend\\Form\\Element\\Text', 'attributes' => array('placeholder' => 'Netfang.', 'required' => 'required'), 'options' => array('label' => 'Netfang')));
     $this->add(array('name' => 'title', 'type' => 'Zend\\Form\\Element\\Select', 'attributes' => array('placeholder' => 'Titill'), 'options' => array('label' => 'Titill', 'empty_option' => 'Veldu starfstitil', 'value_options' => $values->getTitles())));
     $this->add(array('name' => 'submit', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => 'Submit'), 'options' => array('label' => 'Submit')));
 }
Example #2
0
 public function testCreate()
 {
     $service = new Values();
     $this->assertInternalType('array', $service->getBusinessTypes());
     $this->assertInternalType('array', $service->getPostalCode());
     $this->assertInternalType('array', $service->getCompanySizes());
     $this->assertInternalType('array', $service->getTitles());
     $eventManager = new EventManager();
     $this->assertNotEquals($eventManager, $service->getEventManager());
     $service->setEventManager($eventManager);
     $this->assertEquals($eventManager, $service->getEventManager());
 }