Пример #1
0
 /**
  * Check
  * Returns true if no errors occured otherwise false
  * This should be considered a strict check as even case
  * sensitivity will cause an error
  *
  * @access public
  * @return bool
  */
 public function check()
 {
     $errors = $this->parser->getErrors();
     if (count($errors) > 0) {
         return false;
     }
     return true;
 }
Пример #2
0
 public function test_improper_directive_case()
 {
     $contents = file_get_contents($this->_file_path('impropercase'));
     $this->parser = new Glow\Robots\Parser($contents);
     $errors = $this->parser->getErrors();
     $this->assertCount(1, $errors);
     $this->assertEquals($errors[0]['code'], 2);
     $this->assertEquals($errors[0]['message'], 'Allow directive has improper casing - allow should be [Allow]');
     $this->assertEquals($errors[0]['line'], 2);
     $this->assertEquals($errors[0]['level'], 'WARN');
 }
Пример #3
0
 public function test_errors()
 {
     $errors = $this->parser->getErrors();
     $this->assertEquals($errors, array());
 }
 public function test_property_default_errors()
 {
     $this->assertEquals($this->parser->getErrors(), array());
     $this->assertEquals(count($this->parser->getErrors()), 0);
 }