File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -61,4 +61,24 @@ public function testMultipleConnections()
6161 $ this ->assertEquals (1 , count ($ hosts ));
6262 }
6363
64+ public function testQueryLog ()
65+ {
66+ $ this ->assertEquals (0 , count (DB ::getQueryLog ()));
67+
68+ DB ::collection ('items ' )->get ();
69+ $ this ->assertEquals (1 , count (DB ::getQueryLog ()));
70+
71+ DB ::collection ('items ' )->insert (array ('name ' => 'test ' ));
72+ $ this ->assertEquals (2 , count (DB ::getQueryLog ()));
73+
74+ DB ::collection ('items ' )->count ();
75+ $ this ->assertEquals (3 , count (DB ::getQueryLog ()));
76+
77+ DB ::collection ('items ' )->where ('name ' , 'test ' )->update (array ('name ' => 'test ' ));
78+ $ this ->assertEquals (4 , count (DB ::getQueryLog ()));
79+
80+ DB ::collection ('items ' )->where ('name ' , 'test ' )->delete ();
81+ $ this ->assertEquals (5 , count (DB ::getQueryLog ()));
82+ }
83+
6484}
You can’t perform that action at this time.
0 commit comments