@@ -36,6 +36,27 @@ public function testPropertyWithBackslash()
3636 $ this ->assertEquals ('PHPCR\Query\QueryInterface ' , $ rows ->current ()->getValue ('class ' ));
3737 }
3838
39+ /**
40+ * Using /tests_general_base/propertyCharacterComparison/jcr:content
41+ */
42+ public function testPropertyWithDoubleBackslash ()
43+ {
44+ /** @var QueryManager $queryManager */
45+ $ queryManager = $ this ->sharedFixture ['qm ' ];
46+ $ query = $ queryManager ->createQuery ('
47+ SELECT data.doublebackslash
48+ FROM [nt:unstructured] AS data
49+ WHERE data.doublebackslash = "PHPCR \\\\Query \\\\QueryInterface" ' ,
50+ QueryInterface::JCR_SQL2
51+ );
52+
53+ $ result = $ query ->execute ();
54+
55+ $ rows = $ result ->getRows ();
56+ $ this ->assertCount (1 , $ rows );
57+ $ this ->assertEquals ('PHPCR \\\\Query \\\\QueryInterface ' , $ rows ->current ()->getValue ('doublebackslash ' ));
58+ }
59+
3960 /**
4061 * Using /tests_general_base/propertyCharacterComparison/jcr:content
4162 */
@@ -46,7 +67,7 @@ public function testPropertyWithQuotes()
4667 $ query = $ queryManager ->createQuery ('
4768 SELECT data.quotes
4869 FROM [nt:unstructured] AS data
49- WHERE data.quotes = " \\ " \'"
70+ WHERE data.quotes = "\" \'"
5071 ' ,
5172 QueryInterface::JCR_SQL2
5273 );
@@ -57,4 +78,26 @@ public function testPropertyWithQuotes()
5778 $ this ->assertCount (1 , $ rows );
5879 $ this ->assertEquals ('" \'' , $ rows ->current ()->getValue ('quotes ' ));
5980 }
81+
82+ /**
83+ * Using /tests_general_base/propertyCharacterComparison/jcr:content
84+ */
85+ public function testPropertyWithQuotesAndBackslash ()
86+ {
87+ /** @var QueryManager $queryManager */
88+ $ queryManager = $ this ->sharedFixture ['qm ' ];
89+ $ query = $ queryManager ->createQuery ('
90+ SELECT data.quoteandbackslash
91+ FROM [nt:unstructured] AS data
92+ WHERE data.quotes = " \\" \\\'"
93+ ' ,
94+ QueryInterface::JCR_SQL2
95+ );
96+
97+ $ result = $ query ->execute ();
98+
99+ $ rows = $ result ->getRows ();
100+ $ this ->assertCount (1 , $ rows );
101+ $ this ->assertEquals ('" \\\'' , $ rows ->current ()->getValue ('quoteandbackslash ' ));
102+ }
60103}
0 commit comments