コード例 #1
0
 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());
 }
コード例 #2
0
 /**
  *
  * @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;
 }
コード例 #3
0
 /**
  *
  * @return string
  */
 public function getValue()
 {
     return parent::getValue() == '' ? self::DEFAULT_USER_AGENT : parent::getValue();
 }