public function testGeneratedCustomEBNF() { $parser = new pchCommitMessageCheck(array('Done' => pchCommitMessageCheck::REQUIRED, 'Tested' => pchCommitMessageCheck::OPTIONAL, 'Fixed' => pchCommitMessageCheck::PROHIBITED)); $expectation = <<<'EOEBNF' Message ::= Statement+ | Statement* Comment+ Statement ::= Done | Tested | Fixed Comment ::= '# ' TextLine | '#\n' Done ::= '- Done' BugNr ': ' TextLine Text? Tested ::= '- Tested' BugNr? ': ' TextLine Text? Fixed ::= '- Fixed' ': ' TextLine Text? Text ::= ' ' TextLine Text? BugNr ::= ' #' [1-9]+[0-9]* TextLine ::= [\x20-\x7E]+ "\n" EOEBNF; $this->assertEquals($expectation, $parser->getEBNF()); }