@@ -55,8 +55,8 @@ public function testDifferentIndexPartConfiguration()
55
55
{
56
56
$ mapper = $ this ->createMapper ();
57
57
foreach ($ mapper ->find ('_vspace ' ) as $ space ) {
58
- if ($ space[ ' id ' ] >= 512 ) {
59
- $ mapper ->getSpace ($ space[ ' id ' ] )->drop ();
58
+ if ($ space-> id >= 512 ) {
59
+ $ mapper ->getSpace ($ space-> id )->drop ();
60
60
}
61
61
}
62
62
@@ -97,8 +97,8 @@ public function testCreateRow()
97
97
{
98
98
$ mapper = $ this ->createMapper ();
99
99
foreach ($ mapper ->find ('_vspace ' ) as $ space ) {
100
- if ($ space[ ' id ' ] >= 512 ) {
101
- $ mapper ->getSpace ($ space[ ' id ' ] )->drop ();
100
+ if ($ space-> id >= 512 ) {
101
+ $ mapper ->getSpace ($ space-> id )->drop ();
102
102
}
103
103
}
104
104
@@ -156,8 +156,8 @@ public function testFindOrCreateRow()
156
156
{
157
157
$ mapper = $ this ->createMapper ();
158
158
foreach ($ mapper ->find ('_vspace ' ) as $ space ) {
159
- if ($ space[ ' id ' ] >= 512 ) {
160
- $ mapper ->getSpace ($ space[ ' id ' ] )->drop ();
159
+ if ($ space-> id >= 512 ) {
160
+ $ mapper ->getSpace ($ space-> id )->drop ();
161
161
}
162
162
}
163
163
@@ -184,8 +184,8 @@ public function testFindOrCreateRow()
184
184
$ findRow = $ tester ->findOrCreate (['nick ' => 'Billy ' ]);
185
185
$ result = $ mapper ->client ->evaluate ("return box.space.tester.index.nick:select('Jimmy') " )[0 ];
186
186
$ this ->assertTrue ($ result [0 ][1 ] == 0 );
187
- $ this ->assertSame ($ secondRow[ ' id ' ] , $ result [0 ][1 ]);
188
- $ this ->assertSame ($ firstRow , $ findRow );
187
+ $ this ->assertSame ($ secondRow-> id , $ result [0 ][1 ]);
188
+ $ this ->assertEquals ($ firstRow , $ findRow );
189
189
$ tester ->drop ();
190
190
191
191
//id is first field
@@ -199,17 +199,17 @@ public function testFindOrCreateRow()
199
199
$ findRow = $ tester ->findOrCreate (['nick ' => 'Jimmy ' ]);
200
200
$ result = $ mapper ->client ->evaluate ("return box.space.tester.index.nick:select('Jimmy') " )[0 ];
201
201
$ this ->assertTrue ($ result [0 ][0 ] == 2 );
202
- $ this ->assertSame ($ secondRow[ ' id ' ] , $ result [0 ][0 ]);
203
- $ this ->assertSame ($ secondRow , $ findRow );
202
+ $ this ->assertSame ($ secondRow-> id , $ result [0 ][0 ]);
203
+ $ this ->assertEquals ($ secondRow , $ findRow );
204
204
$ tester ->drop ();
205
205
}
206
206
207
207
public function testLua ()
208
208
{
209
209
$ mapper = $ this ->createMapper ();
210
210
foreach ($ mapper ->find ('_vfunc ' ) as $ func ) {
211
- if (strpos ($ func[ ' name ' ] , 'evaluate_ ' ) === 0 ) {
212
- $ mapper ->client ->call ('box.schema.func.drop ' , $ func[ ' name ' ] );
211
+ if (strpos ($ func-> name , 'evaluate_ ' ) === 0 ) {
212
+ $ mapper ->client ->call ('box.schema.func.drop ' , $ func-> name );
213
213
}
214
214
}
215
215
@@ -237,8 +237,8 @@ public function testSpaces()
237
237
$ mapper = $ this ->createMapper ();
238
238
239
239
foreach ($ mapper ->find ('_vspace ' ) as $ space ) {
240
- if ($ space[ ' id ' ] >= 512 ) {
241
- $ mapper ->getSpace ($ space[ ' id ' ] )->drop ();
240
+ if ($ space-> id >= 512 ) {
241
+ $ mapper ->getSpace ($ space-> id )->drop ();
242
242
}
243
243
}
244
244
@@ -263,10 +263,17 @@ public function testSpaces()
263
263
$ space ->addProperty ('name ' , 'string ' );
264
264
$ space ->addProperty ('nick ' , 'string ' , ['default ' => 'nick ' ]);
265
265
266
+ $ space = $ mapper ->createSpace ('object ' );
267
+ $ space ->addProperty ('id ' , 'unsigned ' );
268
+ $ space ->addProperty ('name ' , 'string ' );
269
+ $ space ->addProperty ('nick ' , 'string ' , ['default ' => 'nick ' ]);
270
+
266
271
$ todo = array_keys ($ userTypes );
267
272
$ todo [] = 'array ' ;
273
+ $ todo [] = 'object ' ;
268
274
269
275
foreach ($ todo as $ nick ) {
276
+ $ mapper ->arrays = $ nick == 'array ' ;
270
277
$ space = $ mapper ->getSpace ($ nick );
271
278
$ this ->assertSame ($ space ->getFields (), ['id ' , 'name ' , 'nick ' ]);
272
279
$ this ->assertEquals ($ space ->getFieldFormat ('id ' ), [
0 commit comments