@@ -149,9 +149,15 @@ public function testGetNodeRepositoryException()
149149
150150 public function testGetNodes ()
151151 {
152- $ node1 = $ this ->rootNode ->getNode ('tests_general_base ' );
153- $ iterator = $ this -> rootNode ->getNodes ();
152+ $ parent = $ this ->rootNode ->getNode ('tests_general_base ' );
153+ $ iterator = $ parent ->getNodes ();
154154 $ this ->assertInstanceOf ('Iterator ' , $ iterator );
155+ $ this ->assertInstanceOf ('Countable ' , $ iterator );
156+
157+ $ this ->assertCount (8 , $ iterator );
158+ foreach ($ iterator as $ node ) {
159+ $ this ->assertInstanceOf ('PHPCR\NodeInterface ' , $ node );
160+ }
155161 }
156162
157163 /**
@@ -175,19 +181,44 @@ public function testGetNodesPattern()
175181 $ this ->assertNotContains ('index.txt ' , $ nodes );
176182 }
177183
178- public function testGetNodesPatternAdvanced ()
184+ public function testGetNodesTypeFilter ()
179185 {
180186 $ this ->node = $ this ->rootNode ->getNode ('tests_general_base ' );
181- $ iterator = $ this ->node ->getNodes (" test:* | idExample " );
187+ $ iterator = $ this ->node ->getNodes (null , ' nt:file ' );
182188 $ nodes = array ();
183189 foreach ($ iterator as $ n ) {
184190 $ this ->assertInstanceOf ('PHPCR\NodeInterface ' , $ n );
185191 /** @var $n \PHPCR\NodeInterface */
186192 array_push ($ nodes , $ n ->getName ());
187193 }
194+ $ this ->assertContains ('index.txt ' , $ nodes );
188195 $ this ->assertContains ('idExample ' , $ nodes );
189- $ this ->assertContains ('test:namespacedNode ' , $ nodes );
196+ $ this ->assertNotContains ('test:namespacedNode ' , $ nodes );
197+ $ this ->assertNotContains ('emptyExample ' , $ nodes );
198+ $ this ->assertNotContains ('multiValueProperty ' , $ nodes );
199+ $ this ->assertContains ('numberPropertyNode ' , $ nodes );
200+ $ this ->assertContains ('NumberPropertyNodeToCompare1 ' , $ nodes );
201+ $ this ->assertContains ('NumberPropertyNodeToCompare2 ' , $ nodes );
202+ }
203+
204+ public function testGetNodesTypeFilterList ()
205+ {
206+ $ this ->node = $ this ->rootNode ->getNode ('tests_general_base ' );
207+ $ iterator = $ this ->node ->getNodes ("id* " , array ('nt:file ' , 'nt:folder ' ));
208+ $ nodes = array ();
209+ foreach ($ iterator as $ n ) {
210+ $ this ->assertInstanceOf ('PHPCR\NodeInterface ' , $ n );
211+ /** @var $n \PHPCR\NodeInterface */
212+ array_push ($ nodes , $ n ->getName ());
213+ }
190214 $ this ->assertNotContains ('index.txt ' , $ nodes );
215+ $ this ->assertContains ('idExample ' , $ nodes );
216+ $ this ->assertNotContains ('test:namespacedNode ' , $ nodes );
217+ $ this ->assertNotContains ('emptyExample ' , $ nodes );
218+ $ this ->assertNotContains ('multiValueProperty ' , $ nodes );
219+ $ this ->assertNotContains ('numberPropertyNode ' , $ nodes );
220+ $ this ->assertNotContains ('NumberPropertyNodeToCompare1 ' , $ nodes );
221+ $ this ->assertNotContains ('NumberPropertyNodeToCompare2 ' , $ nodes );
191222 }
192223
193224 public function testGetNodesNameGlobs ()
0 commit comments