|
12 | 12 | namespace PHPCR\Tests\Query;
|
13 | 13 |
|
14 | 14 | use PHPCR\Query\QueryInterface;
|
| 15 | +use PHPCR\Query\RowInterface; |
15 | 16 |
|
16 | 17 | /**
|
17 | 18 | * Run non-trivial queries to try out where, the join features and such.
|
@@ -200,6 +201,32 @@ public function testQueryLeftJoin()
|
200 | 201 | ), $vals);
|
201 | 202 | }
|
202 | 203 |
|
| 204 | + public function testQueryLeftJoinNull() |
| 205 | + { |
| 206 | + /** @var $query QueryInterface */ |
| 207 | + $query = $this->sharedFixture['qm']->createQuery( |
| 208 | + 'SELECT * |
| 209 | + FROM [nt:folder] AS folder |
| 210 | + LEFT OUTER JOIN [nt:file] AS file |
| 211 | + ON ISDESCENDANTNODE(file, folder) |
| 212 | + WHERE NAME(folder) = "emptyExample" |
| 213 | + ', |
| 214 | + QueryInterface::JCR_SQL2 |
| 215 | + ); |
| 216 | + |
| 217 | + $this->assertInstanceOf('\PHPCR\Query\QueryInterface', $query); |
| 218 | + $result = $query->execute(); |
| 219 | + $this->assertInstanceOf('\PHPCR\Query\QueryResultInterface', $result); |
| 220 | + $this->assertCount(1, $result); |
| 221 | + |
| 222 | + /** @var RowInterface $row */ |
| 223 | + $row = $result->getRows()->current(); |
| 224 | + $this->assertInstanceOf('\PHPCR\Query\RowInterface', $row); |
| 225 | + $this->assertEquals('/tests_general_base/emptyExample', $row->getPath('folder')); |
| 226 | + $this->assertNull($row->getPath('file')); |
| 227 | + $this->assertNull($row->getNode('file')); |
| 228 | + } |
| 229 | + |
203 | 230 | public function testQueryRightJoin()
|
204 | 231 | {
|
205 | 232 | /** @var $query QueryInterface */
|
|
0 commit comments