@@ -193,7 +193,7 @@ public function testGetNumRows()
193193 $ this ->loadExampleData ();
194194
195195 static ::$ connection ->setQuery (
196- static ::$ connection ->getQuery ( true )
196+ static ::$ connection ->createQuery ( )
197197 ->select ('* ' )
198198 ->from ('#__dbtest ' )
199199 ->where (static ::$ connection ->quoteName ('description ' ) . ' = ' . static ::$ connection ->quote ('test row one ' ))
@@ -209,7 +209,7 @@ public function testGetNumRows()
209209 */
210210 public function testGetQueryCachedQuery ()
211211 {
212- $ query = static ::$ connection ->getQuery ( true )
212+ $ query = static ::$ connection ->createQuery ( )
213213 ->select ('* ' )
214214 ->from ('#__dbtest ' );
215215
@@ -226,7 +226,7 @@ public function testGetIterator()
226226 $ this ->loadExampleData ();
227227
228228 static ::$ connection ->setQuery (
229- static ::$ connection ->getQuery ( true )
229+ static ::$ connection ->createQuery ( )
230230 ->select ('* ' )
231231 ->from ('#__dbtest ' )
232232 );
@@ -328,9 +328,9 @@ public function testIsMinimumVersion()
328328 }
329329
330330 /**
331- * @testdox The first row of a result set can be loaded as an associative array
332- */
333- public function testLoadAssoc ()
331+ * @testdox The first row of a result set can be loaded as an associative array, using old getQuery(true) syntax
332+ */
333+ public function testLoadAssocWithOldGetQueryTrueSyntax ()
334334 {
335335 $ this ->loadExampleData ();
336336
@@ -348,6 +348,27 @@ public function testLoadAssoc()
348348 );
349349 }
350350
351+ /**
352+ * @testdox The first row of a result set can be loaded as an associative array
353+ */
354+ public function testLoadAssoc ()
355+ {
356+ $ this ->loadExampleData ();
357+
358+ $ result = static ::$ connection ->setQuery (
359+ static ::$ connection ->createQuery ()
360+ ->select ('title ' )
361+ ->from ('#__dbtest ' )
362+ )->loadAssoc ();
363+
364+ $ this ->assertEquals (
365+ [
366+ 'title ' => 'Testing1 ' ,
367+ ],
368+ $ result
369+ );
370+ }
371+
351372 /**
352373 * @testdox All rows of a result set can be loaded as an associative array
353374 */
@@ -356,7 +377,7 @@ public function testLoadAssocList()
356377 $ this ->loadExampleData ();
357378
358379 $ result = static ::$ connection ->setQuery (
359- static ::$ connection ->getQuery ( true )
380+ static ::$ connection ->createQuery ( )
360381 ->select ('title ' )
361382 ->from ('#__dbtest ' )
362383 )->loadAssocList ();
@@ -380,7 +401,7 @@ public function testLoadColumn()
380401 $ this ->loadExampleData ();
381402
382403 $ result = static ::$ connection ->setQuery (
383- static ::$ connection ->getQuery ( true )
404+ static ::$ connection ->createQuery ( )
384405 ->select ('title ' )
385406 ->from ('#__dbtest ' )
386407 )->loadColumn ();
@@ -404,7 +425,7 @@ public function testLoadObject()
404425 $ this ->loadExampleData ();
405426
406427 $ result = static ::$ connection ->setQuery (
407- static ::$ connection ->getQuery ( true )
428+ static ::$ connection ->createQuery ( )
408429 ->select ('* ' )
409430 ->from ('#__dbtest ' )
410431 )->loadObject ();
@@ -428,7 +449,7 @@ public function testLoadObjectList()
428449 $ this ->loadExampleData ();
429450
430451 $ result = static ::$ connection ->setQuery (
431- static ::$ connection ->getQuery ( true )
452+ static ::$ connection ->createQuery ( )
432453 ->select ('* ' )
433454 ->from ('#__dbtest ' )
434455 )->loadObjectList ();
@@ -475,7 +496,7 @@ public function testLoadResult()
475496 $ this ->loadExampleData ();
476497
477498 $ result = static ::$ connection ->setQuery (
478- static ::$ connection ->getQuery ( true )
499+ static ::$ connection ->createQuery ( )
479500 ->select ('* ' )
480501 ->from ('#__dbtest ' )
481502 )->loadResult ();
@@ -491,7 +512,7 @@ public function testLoadRow()
491512 $ this ->loadExampleData ();
492513
493514 $ result = static ::$ connection ->setQuery (
494- static ::$ connection ->getQuery ( true )
515+ static ::$ connection ->createQuery ( )
495516 ->select ('* ' )
496517 ->from ('#__dbtest ' )
497518 )->loadRow ();
@@ -515,7 +536,7 @@ public function testLoadRowList()
515536 $ this ->loadExampleData ();
516537
517538 $ result = static ::$ connection ->setQuery (
518- static ::$ connection ->getQuery ( true )
539+ static ::$ connection ->createQuery ( )
519540 ->select ('* ' )
520541 ->from ('#__dbtest ' )
521542 )->loadRowList ();
@@ -668,7 +689,7 @@ public function testGetAndSetQueryMonitor()
668689 */
669690 public function testSetQueryWithQueryObjectWithoutOffsetOrLimit ()
670691 {
671- $ query = static ::$ connection ->getQuery ( true )
692+ $ query = static ::$ connection ->createQuery ( )
672693 ->select ('* ' )
673694 ->from ('#__dbtest ' );
674695
@@ -690,7 +711,7 @@ public function testSetQueryWithQueryObjectWithoutOffsetOrLimit()
690711 */
691712 public function testSetQueryWithQueryObjectWithOffsetAndLimit ()
692713 {
693- $ query = static ::$ connection ->getQuery ( true )
714+ $ query = static ::$ connection ->createQuery ( )
694715 ->select ('* ' )
695716 ->from ('#__dbtest ' );
696717
@@ -726,7 +747,7 @@ public function testSetQueryWithQueryObjectWithOffsetAndLimit()
726747 */
727748 public function testSetQueryWithQueryObjectWithOffsetAndLimitOnQuery ()
728749 {
729- $ query = static ::$ connection ->getQuery ( true )
750+ $ query = static ::$ connection ->createQuery ( )
730751 ->select ('* ' )
731752 ->from ('#__dbtest ' )
732753 ->setLimit (10 , 3 );
@@ -821,7 +842,7 @@ public function testUpdateObject()
821842
822843 // Fetch row to validate update
823844 $ row = static ::$ connection ->setQuery (
824- static ::$ connection ->getQuery ( true )
845+ static ::$ connection ->createQuery ( )
825846 ->select ('* ' )
826847 ->from ('#__dbtest ' )
827848 ->where ('id = :id ' )
@@ -838,9 +859,9 @@ public function testQuerySetWithUnionAll()
838859 {
839860 $ this ->loadExampleData ();
840861
841- $ query = static ::$ connection ->getQuery ( true );
842- $ union1 = static ::$ connection ->getQuery ( true );
843- $ union2 = static ::$ connection ->getQuery ( true );
862+ $ query = static ::$ connection ->createQuery ( );
863+ $ union1 = static ::$ connection ->createQuery ( );
864+ $ union2 = static ::$ connection ->createQuery ( );
844865
845866 $ union1 ->select ('id, title ' )
846867 ->from ('#__dbtest ' )
@@ -876,8 +897,8 @@ public function testSelectToQuerySetWithUnionAll()
876897 {
877898 $ this ->loadExampleData ();
878899
879- $ query = static ::$ connection ->getQuery ( true );
880- $ union = static ::$ connection ->getQuery ( true );
900+ $ query = static ::$ connection ->createQuery ( );
901+ $ union = static ::$ connection ->createQuery ( );
881902
882903 $ query ->select ('id, title ' )
883904 ->from ('#__dbtest ' )
@@ -912,7 +933,7 @@ public function testRepeatedSelectStatement()
912933 $ this ->loadExampleData ();
913934 $ results = [];
914935
915- $ query = static ::$ connection ->getQuery ( true );
936+ $ query = static ::$ connection ->createQuery ( );
916937 $ query ->select ('id, title ' )
917938 ->from ('#__dbtest ' )
918939 ->where ('id = :id ' )
@@ -948,7 +969,7 @@ public function testMonitorWithReusableQuery()
948969 static ::$ connection ->setMonitor (new DebugMonitor ());
949970
950971 $ title = 'test ' ;
951- $ query = static ::$ connection ->getQuery ( true )
972+ $ query = static ::$ connection ->createQuery ( )
952973 ->select ('id ' )
953974 ->from ('#__dbtest ' )
954975 ->where ('title = :title ' )
@@ -989,7 +1010,7 @@ public function testMonitorWithRepeatedStatement()
9891010 {
9901011 static ::$ connection ->setMonitor (new DebugMonitor ());
9911012
992- $ query = static ::$ connection ->getQuery ( true )
1013+ $ query = static ::$ connection ->createQuery ( )
9931014 ->select ('id ' )
9941015 ->from ('#__dbtest ' )
9951016 ->where ('id = :id ' )
0 commit comments