File tree Expand file tree Collapse file tree
tests/system/Database/Live Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,10 +123,13 @@ public function testWhereNotIn()
123123
124124 public function testSubQuery ()
125125 {
126- $ subQuery = $ this ->db ->table ('job ' )->where ('name ' , 'Developer ' )->getCompiledSelect ();
127-
126+ $ subQuery = $ this ->db ->table ('job ' )
127+ ->select ('id ' )
128+ ->where ('name ' , 'Developer ' )
129+ ->getCompiledSelect ();
130+
128131 $ jobs = $ this ->db ->table ('job ' )
129- ->where ('id not in ( ' . $ subQuery . ') ' , null , false )
132+ ->where ('id not in ( ' . $ subQuery . ') ' , null , false )
130133 ->get ()
131134 ->getResult ();
132135
@@ -136,12 +139,17 @@ public function testSubQuery()
136139 $ this ->assertEquals ('Musician ' , $ jobs [2 ]->name );
137140 }
138141
142+ //--------------------------------------------------------------------
143+
139144 public function testSubQueryAnotherType ()
140145 {
141- $ subQuery = $ this ->db ->table ('job ' )->where ('name ' , 'Developer ' )->getCompiledSelect ();
146+ $ subQuery = $ this ->db ->table ('job ' )
147+ ->select ('id ' )
148+ ->where ('name ' , 'Developer ' )
149+ ->getCompiledSelect ();
142150
143151 $ jobs = $ this ->db ->table ('job ' )
144- ->where ('id = ( ' . $ subQuery . ') ' , null , false )
152+ ->where ('id = ( ' . $ subQuery . ') ' , null , false )
145153 ->get ()
146154 ->getResult ();
147155
You can’t perform that action at this time.
0 commit comments