@@ -206,11 +206,11 @@ public function testReferencesUsesMinimalKeys()
206206 ->will ($ this ->returnValue ($ expected ));
207207 $ class ->expects ($ this ->once ())
208208 ->method ('getFieldMapping ' )
209- ->will ($ this ->returnValue (array ('targetDocument ' => 'Foo ' )));
209+ ->will ($ this ->returnValue (array ('targetDocument ' => 'Foo ' , ' name ' => ' foo ' )));
210210
211211 $ expr = new Expr ($ dm );
212212 $ expr ->setClassMetadata ($ class );
213- $ expr ->field ('foo ' )->references (new \stdClass ());
213+ $ expr ->field ('bar ' )->references (new \stdClass ());
214214
215215 $ this ->assertEquals ($ expected , $ expr ->getQuery (), '->references() uses just $id if a targetDocument is set ' );
216216 }
@@ -239,11 +239,11 @@ public function testReferencesUsesAllKeys()
239239 ->will ($ this ->returnValue ($ expected ));
240240 $ class ->expects ($ this ->once ())
241241 ->method ('getFieldMapping ' )
242- ->will ($ this ->returnValue (array ()));
242+ ->will ($ this ->returnValue (array (' name ' => ' foo ' )));
243243
244244 $ expr = new Expr ($ dm );
245245 $ expr ->setClassMetadata ($ class );
246- $ expr ->field ('foo ' )->references (new \stdClass ());
246+ $ expr ->field ('bar ' )->references (new \stdClass ());
247247
248248 $ this ->assertEquals ($ expected , $ expr ->getQuery (), '->references() uses all keys if no targetDocument is set ' );
249249 }
@@ -272,11 +272,11 @@ public function testReferencesUsesSomeKeys()
272272 ->will ($ this ->returnValue ($ expected ));
273273 $ class ->expects ($ this ->once ())
274274 ->method ('getFieldMapping ' )
275- ->will ($ this ->returnValue (array ('storeAs ' => ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF )));
275+ ->will ($ this ->returnValue (array ('storeAs ' => ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF , ' name ' => ' foo ' )));
276276
277277 $ expr = new Expr ($ dm );
278278 $ expr ->setClassMetadata ($ class );
279- $ expr ->field ('foo ' )->references (new \stdClass ());
279+ $ expr ->field ('bar ' )->references (new \stdClass ());
280280
281281 $ this ->assertEquals ($ expected , $ expr ->getQuery (), '->references() uses some keys if storeAs=dbRef is set ' );
282282 }
0 commit comments