Bladeren bron

Merge pull request #245 from deralex/master

Added test for leading backslash in front of class name to TypeParserTest
Johannes 11 jaren geleden
bovenliggende
commit
955a880b32
1 gewijzigde bestanden met toevoegingen van 9 en 0 verwijderingen
  1. 9 0
      tests/JMS/Serializer/Tests/Serializer/TypeParserTest.php

+ 9 - 0
tests/JMS/Serializer/Tests/Serializer/TypeParserTest.php

@@ -83,6 +83,15 @@ class TypeParserTest extends \PHPUnit_Framework_TestCase
         $this->parser->parse('Foo<aa,>');
         $this->parser->parse('Foo<aa,>');
     }
     }
 
 
+    /**
+     * @expectedException \JMS\Parser\SyntaxErrorException
+     * @expectedExceptionMessage  Expected any of T_NAME or T_STRING, but got "\" of type T_NONE at position 4 (0-based).
+     */
+    public function testLeadingBackslash()
+    {
+        $this->parser->parse('Foo<\Bar>');
+    }
+
     protected function setUp()
     protected function setUp()
     {
     {
         $this->parser = new TypeParser();
         $this->parser = new TypeParser();