@@ -130,19 +130,19 @@ public function testOperations(): void
130
130
$ mm2 = $ mm ->tryLoad (1 );
131
131
$ this ->assertSame ('John ' , $ mm2 ->get ('name ' ));
132
132
$ mm2 = $ mm ->tryLoad (2 );
133
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
133
+ $ this ->assertNull ($ mm2 );
134
134
135
135
$ mm = clone $ m ;
136
136
$ mm ->addCondition ('gender ' , '!= ' , 'M ' );
137
137
$ mm2 = $ mm ->tryLoad (1 );
138
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
138
+ $ this ->assertNull ($ mm2 );
139
139
$ mm2 = $ mm ->tryLoad (2 );
140
140
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
141
141
142
142
$ mm = clone $ m ;
143
143
$ mm ->addCondition ('id ' , '> ' , 1 );
144
144
$ mm2 = $ mm ->tryLoad (1 );
145
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
145
+ $ this ->assertNull ($ mm2 );
146
146
$ mm2 = $ mm ->tryLoad (2 );
147
147
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
148
148
@@ -151,7 +151,7 @@ public function testOperations(): void
151
151
$ mm2 = $ mm ->tryLoad (1 );
152
152
$ this ->assertSame ('John ' , $ mm2 ->get ('name ' ));
153
153
$ mm2 = $ mm ->tryLoad (2 );
154
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
154
+ $ this ->assertNull ($ mm2 );
155
155
}
156
156
157
157
public function testExpressions1 (): void
@@ -174,14 +174,14 @@ public function testExpressions1(): void
174
174
$ mm = clone $ m ;
175
175
$ mm ->addCondition ($ mm ->expr ('[] > 1 ' , [$ mm ->getField ('id ' )]));
176
176
$ mm2 = $ mm ->tryLoad (1 );
177
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
177
+ $ this ->assertNull ($ mm2 );
178
178
$ mm2 = $ mm ->tryLoad (2 );
179
179
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
180
180
181
181
$ mm = clone $ m ;
182
182
$ mm ->addCondition ($ mm ->expr ('[id] > 1 ' ));
183
183
$ mm2 = $ mm ->tryLoad (1 );
184
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
184
+ $ this ->assertNull ($ mm2 );
185
185
$ mm2 = $ mm ->tryLoad (2 );
186
186
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
187
187
}
@@ -206,14 +206,14 @@ public function testExpressions2(): void
206
206
$ mm = clone $ m ;
207
207
$ mm ->addCondition ($ mm ->expr ('[name] = [surname] ' ));
208
208
$ mm2 = $ mm ->tryLoad (1 );
209
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
209
+ $ this ->assertNull ($ mm2 );
210
210
$ mm2 = $ mm ->tryLoad (2 );
211
211
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
212
212
213
213
$ mm = clone $ m ;
214
214
$ mm ->addCondition ($ m ->getField ('name ' ), $ m ->getField ('surname ' ));
215
215
$ mm2 = $ mm ->tryLoad (1 );
216
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
216
+ $ this ->assertNull ($ mm2 );
217
217
$ mm2 = $ mm ->tryLoad (2 );
218
218
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
219
219
@@ -222,14 +222,14 @@ public function testExpressions2(): void
222
222
$ mm2 = $ mm ->tryLoad (1 );
223
223
$ this ->assertSame ('John ' , $ mm2 ->get ('name ' ));
224
224
$ mm2 = $ mm ->tryLoad (2 );
225
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
225
+ $ this ->assertNull ($ mm2 );
226
226
227
227
$ mm = clone $ m ;
228
228
$ mm ->addCondition ($ m ->getField ('name ' ), '!= ' , $ m ->getField ('surname ' ));
229
229
$ mm2 = $ mm ->tryLoad (1 );
230
230
$ this ->assertSame ('John ' , $ mm2 ->get ('name ' ));
231
231
$ mm2 = $ mm ->tryLoad (2 );
232
- $ this ->assertNull ($ mm2-> get ( ' name ' ) );
232
+ $ this ->assertNull ($ mm2 );
233
233
}
234
234
235
235
public function testExpressionJoin (): void
@@ -264,21 +264,20 @@ public function testExpressionJoin(): void
264
264
$ mm = clone $ m ;
265
265
$ mm ->addCondition ($ mm ->expr ('[name] = [surname] ' ));
266
266
$ mm2 = $ mm ->tryLoad (1 );
267
- $ this ->assertFalse ($ mm2-> isLoaded () );
267
+ $ this ->assertNull ($ mm2 );
268
268
$ mm2 = $ mm ->tryLoad (2 );
269
269
$ this ->assertSame ('Sue ' , $ mm2 ->get ('name ' ));
270
270
$ this ->assertSame ('+321 sues ' , $ mm2 ->get ('contact_phone ' ));
271
271
$ mm2 = $ mm ->tryLoad (3 );
272
- $ this ->assertFalse ($ mm2-> isLoaded () );
272
+ $ this ->assertNull ($ mm2 );
273
273
274
274
$ mm = clone $ m ;
275
275
$ mm ->addCondition ($ mm ->expr ('\'+123 smiths \' = [contact_phone] ' ));
276
276
$ mm2 = $ mm ->tryLoad (1 );
277
277
$ this ->assertSame ('John ' , $ mm2 ->get ('name ' ));
278
278
$ this ->assertSame ('+123 smiths ' , $ mm2 ->get ('contact_phone ' ));
279
279
$ mm2 = $ mm ->tryLoad (2 );
280
- $ this ->assertNull ($ mm2 ->get ('name ' ));
281
- $ this ->assertNull ($ mm2 ->get ('contact_phone ' ));
280
+ $ this ->assertNull ($ mm2 );
282
281
$ mm2 = $ mm ->tryLoad (3 );
283
282
$ this ->assertSame ('Peter ' , $ mm2 ->get ('name ' ));
284
283
$ this ->assertSame ('+123 smiths ' , $ mm2 ->get ('contact_phone ' ));
0 commit comments