@@ -69,77 +69,18 @@ function it_should_provide_a_qom_object_for_selecting(
6969 $ res ->offsetGet (0 )->shouldHaveType ('PHPCR\Query\QueryInterface ' );
7070 $ res ->offsetGet (1 )->shouldReturn (array (
7171 array (
72- 'array_op ' => null ,
7372 'selector ' => 'parent ' ,
7473 'name ' => 'foo ' ,
7574 'value ' => 'PHPCR \\FOO \\Bar ' ,
7675 ),
7776 array (
78- 'array_op ' => null ,
7977 'selector ' => 'parent ' ,
8078 'name ' => 'bar ' ,
8179 'value ' => 'foo ' ,
8280 ),
8381 ));
8482 }
8583
86- function it_should_parse_array_values (
87- QueryObjectModelFactoryInterface $ qomf ,
88- ChildNodeJoinConditionInterface $ joinCondition ,
89- JoinInterface $ join ,
90- SourceInterface $ source ,
91- PropertyValueInterface $ tagsValue ,
92- LiteralInterface $ literalValue ,
93- ComparisonInterface $ comparison ,
94- QueryInterface $ query
95- )
96- {
97- $ qomf ->selector ('a ' , 'dtl:article ' )->willReturn ($ source );
98- $ qomf ->createQuery ($ source , null )->willReturn ($ query );
99-
100-
101- $ sql = <<<EOT
102- UPDATE [dtl:article] AS a SET a.tags = ['one', 'two', 'three']
103- EOT ;
104- $ res = $ this ->parse ($ sql );
105-
106- $ res ->offsetGet (0 )->shouldHaveType ('PHPCR\Query\QueryInterface ' );
107- $ res ->offsetGet (1 )->shouldReturn (array (
108- array (
109- 'array_op ' => null ,
110- 'selector ' => 'a ' ,
111- 'name ' => 'tags ' ,
112- 'value ' => array ('one ' , 'two ' , 'three ' ),
113- ),
114- ));
115- }
116-
117- function it_should_parse_array_addition (
118- QueryObjectModelFactoryInterface $ qomf ,
119- SourceInterface $ source ,
120- QueryInterface $ query
121- )
122- {
123- $ qomf ->selector ('a ' , 'dtl:article ' )->willReturn ($ source );
124- $ qomf ->createQuery ($ source , null )->willReturn ($ query );
125-
126-
127- $ sql = <<<EOT
128- UPDATE [dtl:article] AS a SET a.tags[] = 'asd'
129- EOT ;
130- $ res = $ this ->parse ($ sql );
131-
132- $ res ->offsetGet (0 )->shouldHaveType ('PHPCR\Query\QueryInterface ' );
133- $ res ->offsetGet (1 )->shouldReturn (array (
134- array (
135- 'array_op ' => 'add ' ,
136- 'selector ' => 'a ' ,
137- 'name ' => 'tags ' ,
138- 'value ' => 'asd ' ,
139- ),
140- ));
141- }
142-
14384 function it_should_parse_functions (
14485 QueryObjectModelFactoryInterface $ qomf ,
14586 SourceInterface $ source ,
@@ -151,7 +92,7 @@ function it_should_parse_functions (
15192
15293
15394 $ sql = <<<EOT
154- UPDATE [dtl:article] AS a SET a.tags[] = array_replace(a.tags, 'asd', 'dsa')
95+ UPDATE [dtl:article] AS a SET a.tags = array_replace(a.tags, 'asd', 'dsa')
15596EOT ;
15697 $ res = $ this ->parse ($ sql );
15798
0 commit comments