@@ -16,7 +16,7 @@ public function setUp()
16
16
$ user = new User ();
17
17
$ user ->addGroup (new Group ('Test ' ));
18
18
$ this ->dm ->persist ($ user );
19
- $ this ->dm ->flush ();
19
+ $ this ->dm ->flush (null , [ ' w ' => ' majority ' ] );
20
20
$ this ->dm ->clear ();
21
21
}
22
22
@@ -31,6 +31,7 @@ public function testHintIsNotSetByDefault()
31
31
$ this ->assertArrayNotHasKey (Query::HINT_READ_PREFERENCE_TAGS , $ cursor ->getHints ());
32
32
33
33
$ user = $ cursor ->getSingleResult ();
34
+ $ this ->assertInstanceOf (User::class, $ user );
34
35
35
36
$ this ->assertInstanceOf ('Doctrine\ODM\MongoDB\PersistentCollection ' , $ user ->getGroups ());
36
37
$ this ->assertArrayNotHasKey (Query::HINT_READ_PREFERENCE , $ user ->getGroups ()->getHints ());
@@ -53,6 +54,7 @@ public function testHintIsSetOnQuery($readPreference, array $tags = null)
53
54
$ this ->assertReadPreferenceTagsHint ($ tags , $ cursor ->getHints ());
54
55
55
56
$ user = $ cursor ->getSingleResult ();
57
+ $ this ->assertInstanceOf (User::class, $ user );
56
58
57
59
$ this ->assertInstanceOf ('Doctrine\ODM\MongoDB\PersistentCollection ' , $ user ->getGroups ());
58
60
$ this ->assertReadPreferenceHint ($ readPreference , $ user ->getGroups ()->getHints ());
@@ -79,6 +81,7 @@ public function testHintIsSetOnCursor($readPreference, array $tags = null)
79
81
$ this ->assertReadPreferenceTagsHint ($ tags , $ cursor ->getHints ());
80
82
81
83
$ user = $ cursor ->getSingleResult ();
84
+ $ this ->assertInstanceOf (User::class, $ user );
82
85
83
86
$ this ->assertInstanceOf ('Doctrine\ODM\MongoDB\PersistentCollection ' , $ user ->getGroups ());
84
87
$ this ->assertReadPreferenceHint ($ readPreference , $ user ->getGroups ()->getHints ());
@@ -100,8 +103,9 @@ public function testHintIsSetOnPersistentCollection($readPreference, array $tags
100
103
$ this ->assertArrayNotHasKey (Query::HINT_READ_PREFERENCE_TAGS , $ cursor ->getHints ());
101
104
102
105
$ user = $ cursor ->getSingleResult ();
103
- $ groups = $ user -> getGroups ( );
106
+ $ this -> assertInstanceOf (User::class, $ user );
104
107
108
+ $ groups = $ user ->getGroups ();
105
109
$ this ->assertInstanceOf ('Doctrine\ODM\MongoDB\PersistentCollection ' , $ groups );
106
110
107
111
$ groups ->setHints (array (
0 commit comments