19
19
use PHPCR \Query \QOM \PropertyValueInterface ;
20
20
use PHPCR \Query \QOM \QueryObjectModelConstantsInterface ;
21
21
use PHPCR \Query \QOM \QueryObjectModelFactoryInterface ;
22
- use PHPCR \Query \QOM \SourceInterface ;
22
+ use PHPCR \Query \QOM \SelectorInterface ;
23
23
use PHPCR \Query \QueryInterface ;
24
24
use PhpSpec \ObjectBehavior ;
25
25
@@ -42,17 +42,17 @@ public function it_should_provide_a_qom_object_for_selecting(
42
42
QueryObjectModelFactoryInterface $ qomf ,
43
43
ChildNodeJoinConditionInterface $ joinCondition ,
44
44
JoinInterface $ join ,
45
- SourceInterface $ parentSource ,
46
- SourceInterface $ childSource ,
45
+ SelectorInterface $ parentSelector ,
46
+ SelectorInterface $ childSelector ,
47
47
PropertyValueInterface $ childValue ,
48
48
LiteralInterface $ literalValue ,
49
49
ComparisonInterface $ comparison ,
50
50
QueryInterface $ query
51
51
) {
52
- $ qomf ->selector ('parent ' , 'mgnl:page ' )->willReturn ($ parentSource );
53
- $ qomf ->selector ('child ' , 'mgnl:metaData ' )->willReturn ($ childSource );
52
+ $ qomf ->selector ('parent ' , 'mgnl:page ' )->willReturn ($ parentSelector );
53
+ $ qomf ->selector ('child ' , 'mgnl:metaData ' )->willReturn ($ childSelector );
54
54
$ qomf ->childNodeJoinCondition ('child ' , 'parent ' )->willReturn ($ joinCondition );
55
- $ qomf ->join ($ parentSource , $ childSource , QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER , $ joinCondition )->willReturn ($ join );
55
+ $ qomf ->join ($ parentSelector , $ childSelector , QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER , $ joinCondition )->willReturn ($ join );
56
56
$ qomf ->propertyValue ('child ' , 'mgnl:template ' )->willReturn ($ childValue );
57
57
$ qomf ->literal ('standard-templating-kit:stkNews ' )->willReturn ($ literalValue );
58
58
$ qomf ->comparison ($ childValue , QueryObjectModelConstantsInterface::JCR_OPERATOR_EQUAL_TO , $ literalValue )->willReturn ($ comparison );
@@ -68,9 +68,9 @@ public function it_should_provide_a_qom_object_for_selecting(
68
68
WHERE
69
69
child.[mgnl:template] = 'standard-templating-kit:stkNews'
70
70
EOT;
71
- $ res = $ this ->parse ($ sql );
71
+ $ res = $ this ->parseUpdate ($ sql );
72
72
73
- $ res ->offsetGet (0 )->shouldHaveType (' PHPCR\Query\ QueryInterface' );
73
+ $ res ->offsetGet (0 )->shouldHaveType (QueryInterface::class );
74
74
$ res ->offsetGet (1 )->shouldReturn ([
75
75
[
76
76
'selector ' => 'parent ' ,
@@ -87,7 +87,7 @@ public function it_should_provide_a_qom_object_for_selecting(
87
87
88
88
public function it_should_parse_functions (
89
89
QueryObjectModelFactoryInterface $ qomf ,
90
- SourceInterface $ source ,
90
+ SelectorInterface $ source ,
91
91
QueryInterface $ query
92
92
) {
93
93
$ qomf ->selector ('a ' , 'dtl:article ' )->willReturn ($ source );
@@ -96,14 +96,14 @@ public function it_should_parse_functions(
96
96
$ sql = <<<'EOT'
97
97
UPDATE [dtl:article] AS a SET a.tags = array_replace(a.tags, 'asd', 'dsa')
98
98
EOT;
99
- $ res = $ this ->parse ($ sql );
99
+ $ res = $ this ->parseUpdate ($ sql );
100
100
101
101
$ res ->offsetGet (0 )->shouldHaveType ('PHPCR\Query\QueryInterface ' );
102
102
}
103
103
104
104
public function it_should_parse_apply (
105
105
QueryObjectModelFactoryInterface $ qomf ,
106
- SourceInterface $ source ,
106
+ SelectorInterface $ source ,
107
107
QueryInterface $ query
108
108
) {
109
109
$ qomf ->selector ('a ' , 'dtl:article ' )->willReturn ($ source );
@@ -112,7 +112,7 @@ public function it_should_parse_apply(
112
112
$ sql = <<<'EOT'
113
113
UPDATE [dtl:article] AS a APPLY nodetype_add('nt:barbar')
114
114
EOT;
115
- $ res = $ this ->parse ($ sql );
115
+ $ res = $ this ->parseUpdate ($ sql );
116
116
117
117
$ res ->offsetGet (0 )->shouldHaveType ('PHPCR\Query\QueryInterface ' );
118
118
}
0 commit comments