Permalink
Browse files

added a test for the escape illegal characters

  • Loading branch information...
1 parent e27834a commit 0ac4fce50cb5e5b73526f7bc82b257f44513d6a0 @nicam nicam committed Feb 21, 2012
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/Doctrine/Tests/ODM/PHPCR/DocumentManagerTest.php
@@ -86,6 +86,19 @@ public function testGetRepository()
// call again to test the cache
$this->assertInstanceOf('Doctrine\ODM\PHPCR\DocumentRepository', $dm->getRepository('foo'));
}
+
+ /**
+ * @covers Doctrine\ODM\PHPCR\DocumentManager::escapeIllegalCharacters
+ */
+ public function testEscapeIllegalCharacters()
+ {
+ $session = $this->getMock('PHPCR\SessionInterface');
+
+ $dm = DocumentManager::create($session);
+
+ $string = $dm->escapeIllegalCharacters('Some{String}Wit"h[]Illegal^^^Chara\cte?rs:!');
+ $this->assertEquals($string, 'Some\{String\}Wit"h\[\]Illegal\^\^\^Chara\cte\?rs\:\!');
+ }
}
class DocumentManagerGetClassMetadata extends DocumentManager

0 comments on commit 0ac4fce

Please sign in to comment.