public function testParseVaildDirectiveFromString() { $directive = new Directive(); $directive->parse('allow:/allowed-path'); $this->assertTrue($directive->isValid()); $this->assertEquals('allow', (string) $directive->getField()); $this->assertEquals('/allowed-path', (string) $directive->getValue()); }
/** * * @param \webignition\RobotsTxt\Directive\Directive $directive * @return boolean */ public function equals(\webignition\RobotsTxt\Directive\Directive $directive) { if ((string) $this->getField() != (string) $directive->getField()) { return false; } if ((string) $this->getValue() != (string) $directive->getValue()) { return false; } return true; }
/** * * @return string */ public function getValue() { return parent::getValue() == '' ? self::DEFAULT_USER_AGENT : parent::getValue(); }