Inheritance: extends Flitch\Rule\AbstractRule
Example #1
0
 public function testConstantNaming()
 {
     $tokenizer = new Tokenizer();
     $file = $tokenizer->tokenize('foo.php', "<?php class foo { const BAR = 'baz'; const BAZ = 'bar'; }");
     $file->rewind();
     $file->seekTokenType(T_CONST);
     $rule = new Constants();
     $rule->setFormat('BAZ');
     $rule->visitToken($file);
     $this->assertRuleViolations($file, array(array('line' => 1, 'column' => 25, 'message' => 'Constant name does not match format "BAZ"', 'source' => 'Flitch\\Naming\\Constants')));
 }