Beispiel #1
0
 public function testPopulateFromArray()
 {
     $properties = array('identifier' => 'btnSave');
     $this->button->populateFromArray($properties);
     $this->assertEquals($properties['identifier'], $this->button->getIdentifier());
 }
Beispiel #2
0
 public function getSubmitingButton()
 {
     $button = null;
     $request = $this->getRequest();
     $callback = function (Button &$component) use(&$button, $request) {
         $value = $request->getPostedParameter($component->getName());
         if ($value != null) {
             $button = $component;
             return Component::VISITOR_STOP_TRAVERSAL;
         }
         return Component::VISITOR_CONTINUE_TRAVERSAL;
     };
     $this->visitChildren(Button::getIdentifier(), $callback);
     return $button;
 }