@@ -86,10 +86,20 @@ public function testSameNodeJoin()
8686 $ condition = new QOM \SameNodeJoinCondition ('sel1 ' , 'sel2 ' );
8787 $ this ->assertQuery ($ this ->queries ['6.7.9.SameNodeJoinCondition.Simple ' ], $ this ->factory ->join ($ left , $ right , Constants::JCR_JOIN_TYPE_INNER , $ condition ));
8888
89- //TODO: should path be surronded by quotes?
9089 $ condition = new QOM \SameNodeJoinCondition ('sel1 ' , 'sel2 ' , '/home ' );
9190 $ this ->assertQuery ($ this ->queries ['6.7.9.SameNodeJoinCondition.Path ' ], $ this ->factory ->join ($ left , $ right , Constants::JCR_JOIN_TYPE_INNER , $ condition ));
91+ }
92+
93+ /**
94+ * 6.7.9. SameNodeJoinCondition with space in path
95+ */
96+ public function testSameNodeJoinSpace ()
97+ {
98+ $ left = $ this ->factory ->selector ('nt:file ' );
99+ $ right = $ this ->factory ->selector ('nt:folder ' );
92100
101+ $ condition = new QOM \SameNodeJoinCondition ('sel1 ' , 'sel2 ' , '/home node ' );
102+ $ this ->assertQuery ($ this ->queries ['6.7.9.SameNodeJoinCondition.Path_Space ' ], $ this ->factory ->join ($ left , $ right , Constants::JCR_JOIN_TYPE_INNER , $ condition ));
93103 }
94104
95105 /**
@@ -188,6 +198,16 @@ public function testSameNode()
188198 $ this ->assertQuery ($ this ->queries ['6.7.20.SameNode.Selector ' ], $ selector , array (), $ this ->factory ->sameNode ('/home ' , 'sel1 ' ), array ());
189199 }
190200
201+ /**
202+ * 6.7.20. SameNode with space in path
203+ */
204+ public function testSameNodeSpace ()
205+ {
206+ $ selector = $ this ->factory ->selector ('nt:file ' );
207+ $ this ->assertQuery ($ this ->queries ['6.7.20.SameNode.Simple_Space ' ], $ selector , array (), $ this ->factory ->sameNode ('/home node ' ), array ());
208+ $ this ->assertQuery ($ this ->queries ['6.7.20.SameNode.Selector_Space ' ], $ selector , array (), $ this ->factory ->sameNode ('/home node ' , 'sel1 ' ), array ());
209+ }
210+
191211 /**
192212 * 6.7.21. ChildNode
193213 */
@@ -198,6 +218,16 @@ public function testChildNode()
198218 $ this ->assertQuery ($ this ->queries ['6.7.21.ChildNode.Selector ' ], $ selector , array (), $ this ->factory ->childNode ('/home ' , 'sel1 ' ), array ());
199219 }
200220
221+ /**
222+ * 6.7.21. ChildNode with space in path
223+ */
224+ public function testChildNodeSpace ()
225+ {
226+ $ selector = $ this ->factory ->selector ('nt:file ' );
227+ $ this ->assertQuery ($ this ->queries ['6.7.21.ChildNode.Simple_Space ' ], $ selector , array (), $ this ->factory ->childNode ('/home node ' ), array ());
228+ $ this ->assertQuery ($ this ->queries ['6.7.21.ChildNode.Selector_Space ' ], $ selector , array (), $ this ->factory ->childNode ('/home node ' , 'sel1 ' ), array ());
229+ }
230+
201231 /**
202232 * 6.7.22. DescendantNode
203233 */
@@ -208,6 +238,16 @@ public function testDescendantNode()
208238 $ this ->assertQuery ($ this ->queries ['6.7.22.DescendantNode.Selector ' ], $ selector , array (), $ this ->factory ->descendantNode ('/home ' , 'sel1 ' ), array ());
209239 }
210240
241+ /**
242+ * 6.7.22. DescendantNode with space in path
243+ */
244+ public function testDescendantNodeSpace ()
245+ {
246+ $ selector = $ this ->factory ->selector ('nt:file ' );
247+ $ this ->assertQuery ($ this ->queries ['6.7.22.DescendantNode.Simple_Space ' ], $ selector , array (), $ this ->factory ->descendantNode ('/home node ' ), array ());
248+ $ this ->assertQuery ($ this ->queries ['6.7.22.DescendantNode.Selector_Space ' ], $ selector , array (), $ this ->factory ->descendantNode ('/home node ' , 'sel1 ' ), array ());
249+ }
250+
211251 /**
212252 * 6.7.23. Path
213253 */
0 commit comments