示例#1
0
 /**
  * @param \FSi\Bundle\AdminBundle\Admin\Element $element
  */
 function it_remove_element_by_id($element)
 {
     $element->getId()->willReturn('foo');
     $this->addElement($element);
     $this->hasElement('foo')->shouldReturn(true);
     $this->removeElement('foo');
     $this->hasElement('foo')->shouldReturn(false);
 }
示例#2
0
 /**
  * @param Element $element
  * @param array $testedRouteParameters
  * @return bool
  */
 private function isRouteMatchingElementDirectly(Element $element, array $testedRouteParameters)
 {
     if (!isset($testedRouteParameters['element'])) {
         return false;
     }
     return $testedRouteParameters['element'] === $element->getId();
 }
示例#3
0
 /**
  * @param \FSi\Bundle\AdminBundle\Admin\Element $element
  * @return \FSi\Bundle\AdminBundle\Admin\Manager
  */
 public function addElement(Element $element)
 {
     $this->elements[$element->getId()] = $element;
     return $this;
 }