/** * @depends testSet * * @author Lionel Lecaque, lionel@taotesting.com */ public function testRemove() { $interactions = CustomInteractionRegistry::getRegistry()->getMap(); $this->assertTrue(isset($interactions['fakeInteraction'])); CustomInteractionRegistry::getRegistry()->remove('fakeInteraction'); $interactions = CustomInteractionRegistry::getRegistry()->getMap(); }
/** * Parse and build a custom interaction object * * @param DOMElement $data * @return CustomInteraction * @throws ParsingException */ private function buildCustomInteraction(DOMElement $data) { $interaction = null; if ($this->isPciNode($data)) { //use tao's implementation of portable custom interaction $interaction = new PortableCustomInteraction($this->extractAttributes($data), $this->item); $interaction->feed($this, $data); } else { $ciClass = ''; $classes = $data->getAttribute('class'); $classeNames = split('/\\s+/', $classes); foreach ($classeNames as $classeName) { $ciClass = CustomInteractionRegistry::getCustomInteractionByName($classeName); if ($ciClass) { $interaction = new $ciClass($this->extractAttributes($data), $this->item); $interaction->feed($this, $data); break; } } if (!$ciClass) { throw new ParsingException('unknown custom interaction to be build'); } } return $interaction; }