/** * @test */ public function getComponentShouldReturnNullIfAskedForComponentOutOfRange() { $r = new Rule(1, 'Foo', array('x', 'y')); $this->assertEquals('y', $r->getComponent(1)); $this->assertNull($r->getComponent(2)); }
/** * Returns the currently expected component. * * If the item is: * * <pre> * A -> a . b c * </pre> * * then this method returns the component "b". * * @return string The component. */ public function getActiveComponent() { return $this->rule->getComponent($this->dotIndex); }