11<?php
22namespace PHPCR \Tests \Query ;
33
4+ use PHPCR \Query \QueryInterface ;
5+
46require_once ('QueryBaseCase.php ' );
57
68/**
@@ -10,9 +12,10 @@ class QuerySql2OperationsTest extends QueryBaseCase
1012{
1113 public function testQueryField ()
1214 {
15+ /** @var $query QueryInterface */
1316 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
1417 'SELECT foo FROM [nt:unstructured] WHERE foo = "bar" ' ,
15- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
18+ QueryInterface::JCR_SQL2
1619 );
1720
1821 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
@@ -33,9 +36,10 @@ public function testQueryField()
3336
3437 public function testQueryFieldSomenull ()
3538 {
39+ /** @var $query QueryInterface */
3640 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
3741 'SELECT foo FROM [nt:unstructured] ' ,
38- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
42+ QueryInterface::JCR_SQL2
3943 );
4044
4145 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
@@ -46,21 +50,22 @@ public function testQueryFieldSomenull()
4650 $ vals [] = ($ node ->hasProperty ('foo ' ) ? $ node ->getPropertyValue ('foo ' ) : null );
4751 }
4852 $ this ->assertContains ('bar ' , $ vals );
49- $ this ->assertEquals (8 , count ($ vals ));
53+ $ this ->assertEquals (10 , count ($ vals ));
5054
5155 $ vals = array ();
5256 foreach ($ result ->getRows () as $ row ) {
5357 $ vals [] = $ row ->getValue ('foo ' );
5458 }
5559 $ this ->assertContains ('bar ' , $ vals );
56- $ this ->assertEquals (8 , count ($ vals ));
60+ $ this ->assertEquals (10 , count ($ vals ));
5761 }
5862
5963 public function testQueryFieldSelector ()
6064 {
65+ /** @var $query QueryInterface */
6166 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
6267 'SELECT data.foo FROM [nt:unstructured] AS data WHERE data.foo = "bar" ' ,
63- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
68+ QueryInterface::JCR_SQL2
6469 );
6570
6671 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
@@ -75,14 +80,15 @@ public function testQueryFieldSelector()
7580
7681 public function testQueryJoin ()
7782 {
83+ /** @var $query QueryInterface */
7884 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
7985 'SELECT content.longNumber
8086 FROM [nt:file] AS file
8187 INNER JOIN [nt:unstructured] AS content
8288 ON ISDESCENDANTNODE(content, file)
8389
8490 WHERE content.longNumber = 999 ' ,
85- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
91+ QueryInterface::JCR_SQL2
8692 );
8793
8894 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
@@ -98,14 +104,15 @@ public function testQueryJoin()
98104
99105 public function testQueryJoinReference ()
100106 {
107+ /** @var $query QueryInterface */
101108 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
102109 'SELECT source.ref1, target.[jcr:uuid]
103110 FROM [nt:unstructured] AS source
104111 INNER JOIN [nt:unstructured] AS target
105112 ON source.ref1 = target.[jcr:uuid]
106113 WHERE ISCHILDNODE(source, "/tests_general_base/idExample/jcr:content")
107114 ' ,
108- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
115+ QueryInterface::JCR_SQL2
109116 );
110117
111118 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
@@ -120,11 +127,12 @@ public function testQueryJoinReference()
120127
121128 public function testQueryOrder ()
122129 {
130+ /** @var $query QueryInterface */
123131 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
124132 'SELECT data.zeronumber
125133 FROM [nt:unstructured] AS data
126134 ORDER BY data.zeronumber ' ,
127- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
135+ QueryInterface::JCR_SQL2
128136 );
129137
130138 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
@@ -135,19 +143,19 @@ public function testQueryOrder()
135143 $ vals [] = $ row ->getValue ('data.zeronumber ' );
136144 }
137145 // rows that do not have that field are null. empty is before fields with values
138- $ this ->assertEquals (array (null , null , null , null , null , null , null , 0 ), $ vals );
146+ $ this ->assertEquals (array (null , null , null , null , null , null , null , null , null , 0 ), $ vals );
139147 }
140148
141149 public function testQueryMultiValuedProperty ()
142150 {
143- /** @var $query \PHPCR\Query\ QueryInterface */
151+ /** @var $query QueryInterface */
144152 $ query = $ this ->sharedFixture ['qm ' ]->createQuery (
145153 'SELECT data.tags
146154 FROM [nt:unstructured] AS data
147155 WHERE data.tags = "foo"
148156 AND data.tags = "bar"
149157 ' ,
150- \ PHPCR \ Query \ QueryInterface::JCR_SQL2
158+ QueryInterface::JCR_SQL2
151159 );
152160
153161 $ this ->assertInstanceOf ('\PHPCR\Query\QueryInterface ' , $ query );
0 commit comments