File tree Expand file tree Collapse file tree 5 files changed +6
-8
lines changed
tests/integration/Collection Expand file tree Collapse file tree 5 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -945,6 +945,8 @@ public function bsonUnserialize(array $data): void
945945
946946 $ this ->collectionsManager = $ collectionsManager ;
947947
948+ $ this ->dirtyState = self ::DIRTY_STATE_PERSISTENT ;
949+
948950 foreach ($ data as $ key => $ value ) {
949951 $ this ->writeAttribute ($ key , $ value );
950952 }
@@ -1406,10 +1408,6 @@ protected static function getResultset(
14061408 return null ;
14071409 }
14081410
1409- if (method_exists ($ base , 'afterFetch ' )) {
1410- $ base ->afterFetch ();
1411- }
1412-
14131411 return $ document ;
14141412 }
14151413
@@ -1418,10 +1416,6 @@ protected static function getResultset(
14181416 */
14191417 $ documentsCursor = $ mongoCollection ->find ($ conditions , $ parameters );
14201418
1421- if (method_exists ($ base , 'afterFetch ' )) {
1422- $ base ->afterFetch ();
1423- }
1424-
14251419 return $ documentsCursor ->toArray ();
14261420 }
14271421
Original file line number Diff line number Diff line change @@ -44,5 +44,6 @@ public function mvcCollectionConstruct(IntegrationTester $I)
4444
4545 $ robot = new Robots ();
4646 $ I ->assertInstanceOf (Robots::class, $ robot );
47+ $ I ->assertEquals (Robots::DIRTY_STATE_TRANSIENT , $ robot ->getDirtyState ());
4748 }
4849}
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public function mvcCollectionCreate(IntegrationTester $I)
5454 $ robot = new Robots ();
5555 $ robot ->first_name = null ;
5656 $ I ->assertTrue ($ robot ->create ());
57+ $ I ->assertEquals (Robots::DIRTY_STATE_PERSISTENT , $ robot ->getDirtyState ());
5758
5859 $ search = $ this ->mongo ->selectCollection ($ this ->source )->findOne (['_id ' => $ robot ->getId ()]);
5960 $ I ->assertNotNull ($ search );
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ public function mvcCollectionFindFirst(IntegrationTester $I)
6767
6868 /** @var Robots|bool $firstRobot */
6969 $ firstRobot = Robots::findFirst ();
70+ $ I ->assertEquals (Robots::DIRTY_STATE_PERSISTENT , $ firstRobot ->getDirtyState ());
7071
7172 /** @var Robots|bool $robot */
7273 $ robot = Robots::findFirst ([['last_name ' => 'Nobody ' ]]);
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public function mvcCollectionUpdate(IntegrationTester $I)
6565
6666 $ robot ->last_name = 'X ' ;
6767 $ I ->assertTrue ($ robot ->update ());
68+ $ I ->assertEquals (Robots::DIRTY_STATE_PERSISTENT , $ robot ->getDirtyState ());
6869
6970 $ updated = $ this ->mongo ->selectCollection ($ this ->source )->findOne (['_id ' => $ robot ->getId ()]);
7071 $ I ->assertEquals ($ updated ['last_name ' ], 'X ' );
You can’t perform that action at this time.
0 commit comments