/** * @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); }
/** * @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(); }
/** * @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; }