-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathQueryManagerTest.php
More file actions
70 lines (60 loc) · 2 KB
/
Copy pathQueryManagerTest.php
File metadata and controls
70 lines (60 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/*
* This file is part of the PHPCR API Tests package
*
* Copyright (c) 2015 Liip and others
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPCR\Tests\Query;
/**
* tests for the query manager, $ 6.8.
*
* TODO: getQOMFactory
*/
class QueryManagerTest extends QueryBaseCase
{
public static function setupBeforeClass($fixture = 'general/query')
{
parent::setupBeforeClass($fixture);
}
public function testCreateQuerySql2()
{
$ret = $this->sharedFixture['qm']->createQuery("SELECT * FROM [nt:folder] WHERE ISCHILDNODE('/tests_general/base')", \PHPCR\Query\QueryInterface::JCR_SQL2);
$this->assertInstanceOf('PHPCR\Query\QueryInterface', $ret);
}
/**
* @expectedException \PHPCR\Query\InvalidQueryException
*/
public function testCreateQueryInvalid()
{
$this->sharedFixture['qm']->createQuery(null, 'some-not-existing-query-language');
}
public function testGetQuery()
{
$qnode = $this->session->getNode('/tests_general_query/queryNode');
$this->assertInstanceOf('PHPCR\NodeInterface', $qnode);
$query = $this->sharedFixture['qm']->getQuery($qnode);
$this->assertInstanceOf('PHPCR\Query\QueryInterface', $query);
}
/**
* @expectedException \PHPCR\Query\InvalidQueryException
*/
public function testGetQueryInvalid()
{
$this->sharedFixture['qm']->getQuery($this->rootNode);
}
public function testGetQOMFactory()
{
$factory = $this->sharedFixture['qm']->getQOMFactory();
$this->assertInstanceOf('PHPCR\Query\QOM\QueryObjectModelFactoryInterface', $factory);
}
public function testGetSupportedQueryLanguages()
{
$ret = $this->sharedFixture['qm']->getSupportedQueryLanguages();
$this->assertInternalType('array', $ret);
$this->assertContains('JCR-SQL2', $ret);
$this->assertContains('JCR-JQOM', $ret);
}
}