瀏覽代碼

Added test for leading backslash in front of class name to TypeParserTest

testLeadingBackslash added to check if there's a leading backslash in
front of a class name.

Signed-off-by: Alexander Kluth <contact@alexanderkluth.com>
Alexander Kluth 11 年之前
父節點
當前提交
25d5b40634
共有 1 個文件被更改,包括 9 次插入0 次删除
  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,>');
     }
 
+    /**
+     * @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()
     {
         $this->parser = new TypeParser();