public function getNodeFor($stateKey) { foreach ($this->stateStack as $assoc) { if ($assoc['key'] === $stateKey) { return $assoc['node']; } } throw new \InvalidArgumentException("{$stateKey} is not a currently stacked state"); }
/** * @expectedException \InvalidArgumentException */ public function testNoNodeFound() { $this->buildVisitorUnique(); $this->sut->getNodeFor('fddbfgb'); }