public function testIntegrity()
 {
     $errors = file(__DIR__ . '/../../fixtures/normalised-error-strings.txt');
     $linkifier = new HtmlValidationErrorLinkifier();
     foreach ($errors as $error) {
         $error = trim($error);
         $linkifier->linkify($error);
         //            var_dump($error);
         //            var_dump($linkifier->linkify($error));
         //            print("\n");
     }
 }
 public function testReplaceSpaces()
 {
     $linkifier = new HtmlValidationErrorLinkifier();
     $linkified = $linkifier->linkify('one two three');
     $this->assertEquals('one-two-three', $linkified);
 }
 public function testReplacePlaceholdersWithLetters()
 {
     $linkifier = new HtmlValidationErrorLinkifier();
     $linkified = $linkifier->linkify('Foo %0 not allowed in bar %1');
     $this->assertEquals('foo-x-not-allowed-in-bar-y', $linkified);
 }
 public function testRepaceDoubleHyphens()
 {
     $linkifier = new HtmlValidationErrorLinkifier();
     $linkified = $linkifier->linkify('foo--bar---foobar');
     $this->assertEquals('foo-bar-foobar', $linkified);
 }
 public function testReplaceAmpersandEntity()
 {
     $linkifier = new HtmlValidationErrorLinkifier();
     $linkified = $linkifier->linkify('Required attribute "%0" not specified', array('type'));
     $this->assertEquals('required-attribute-type-not-specified', $linkified);
 }
 public function testReplaceSlashAngleBracket()
 {
     $linkifier = new HtmlValidationErrorLinkifier();
     $linkified = $linkifier->linkify('foo/>bar');
     $this->assertEquals('foobar', $linkified);
 }
 public function testReplaceAmperandAndAmperandEntity()
 {
     $linkifier = new HtmlValidationErrorLinkifier();
     $linkified = $linkifier->linkify('& did not start a character reference. (& probably should have been escaped as &.)');
     $this->assertEquals('ampersand-did-not-start-a-character-reference-ampersand-probably-should-have-been-escaped-as-amp', $linkified);
 }