You are here

public function PatternsParserTestCase::check_valid_syntax_only in Patterns 7.2

File

tests/parser/parser.test, line 57
SimpleTests for the Taxonomy component of Patterns.

Class

PatternsParserTestCase
@file SimpleTests for the Taxonomy component of Patterns.

Code

public function check_valid_syntax_only($pattern) {
  $scan = $this
    ->scan_pattern($pattern);
  $analysis = $this
    ->analyze_scan($scan, PATTERNS_VALIDATE_SYNTAX);
  $this
    ->assertEqual(count($analysis), 0, t('No error message generated while parsing syntactically valid pattern.'));
  $analysis = $this
    ->analyze_scan($scan, PATTERNS_VALIDATE_ALL);
  $this
    ->assertNotEqual(count($analysis), 0, t('Error messages generated while parsing semantically invalid pattern.'));
}