@@ -2050,7 +2050,7 @@ public function testEmptyBuilderNoFrom(): void
20502050 {
20512051 $ this ->expectException (ValidationException::class);
20522052 $ this ->expectExceptionMessage ('No table specified ' );
2053- (new Builder ())->from ( '' )-> build ();
2053+ (new Builder ())->build ();
20542054 }
20552055
20562056 public function testCursorWithLimitAndOffset (): void
@@ -5452,15 +5452,14 @@ public function testBuildWithNoFromNoFilters(): void
54525452 {
54535453 $ this ->expectException (ValidationException::class);
54545454 $ this ->expectExceptionMessage ('No table specified ' );
5455- (new Builder ())->from ( '' )-> build ();
5455+ (new Builder ())->build ();
54565456 }
54575457
54585458 public function testBuildWithOnlyLimit (): void
54595459 {
54605460 $ this ->expectException (ValidationException::class);
54615461 $ this ->expectExceptionMessage ('No table specified ' );
54625462 (new Builder ())
5463- ->from ('' )
54645463 ->limit (10 )
54655464 ->build ();
54665465 }
@@ -5470,7 +5469,6 @@ public function testBuildWithOnlyOffset(): void
54705469 $ this ->expectException (ValidationException::class);
54715470 $ this ->expectExceptionMessage ('No table specified ' );
54725471 (new Builder ())
5473- ->from ('' )
54745472 ->offset (50 )
54755473 ->build ();
54765474 }
@@ -5480,7 +5478,6 @@ public function testBuildWithOnlySort(): void
54805478 $ this ->expectException (ValidationException::class);
54815479 $ this ->expectExceptionMessage ('No table specified ' );
54825480 (new Builder ())
5483- ->from ('' )
54845481 ->sortAsc ('name ' )
54855482 ->build ();
54865483 }
@@ -5490,7 +5487,6 @@ public function testBuildWithOnlySelect(): void
54905487 $ this ->expectException (ValidationException::class);
54915488 $ this ->expectExceptionMessage ('No table specified ' );
54925489 (new Builder ())
5493- ->from ('' )
54945490 ->select (['a ' , 'b ' ])
54955491 ->build ();
54965492 }
@@ -5500,7 +5496,6 @@ public function testBuildWithOnlyAggregationNoFrom(): void
55005496 $ this ->expectException (ValidationException::class);
55015497 $ this ->expectExceptionMessage ('No table specified ' );
55025498 (new Builder ())
5503- ->from ('' )
55045499 ->count ('* ' , 'total ' )
55055500 ->build ();
55065501 }
@@ -6017,7 +6012,7 @@ public function testEmptyTableWithJoin(): void
60176012 {
60186013 $ this ->expectException (ValidationException::class);
60196014 $ this ->expectExceptionMessage ('No table specified ' );
6020- (new Builder ())->from ( '' )-> join ('other ' , 'a ' , 'b ' )->build ();
6015+ (new Builder ())->join ('other ' , 'a ' , 'b ' )->build ();
60216016 }
60226017
60236018 public function testBuildWithoutFromCall (): void
@@ -7052,7 +7047,7 @@ public function testSelectRaw(): void
70527047 {
70537048 $ result = (new Builder ())
70547049 ->from ('orders ' )
7055- ->selectRaw ('SUM(amount) AS total ' )
7050+ ->select ('SUM(amount) AS total ' )
70567051 ->build ();
70577052 $ this ->assertBindingCount ($ result );
70587053
@@ -7063,7 +7058,7 @@ public function testSelectRawWithBindings(): void
70637058 {
70647059 $ result = (new Builder ())
70657060 ->from ('orders ' )
7066- ->selectRaw ('IF(amount > ?, 1, 0) AS big_order ' , [1000 ])
7061+ ->select ('IF(amount > ?, 1, 0) AS big_order ' , [1000 ])
70677062 ->build ();
70687063 $ this ->assertBindingCount ($ result );
70697064
@@ -7076,7 +7071,7 @@ public function testSelectRawCombinedWithSelect(): void
70767071 $ result = (new Builder ())
70777072 ->from ('orders ' )
70787073 ->select (['id ' , 'customer_id ' ])
7079- ->selectRaw ('SUM(amount) AS total ' )
7074+ ->select ('SUM(amount) AS total ' )
70807075 ->build ();
70817076 $ this ->assertBindingCount ($ result );
70827077
@@ -7094,7 +7089,7 @@ public function testSelectRawWithCaseExpression(): void
70947089 $ result = (new Builder ())
70957090 ->from ('users ' )
70967091 ->select (['id ' ])
7097- ->selectRaw ($ case ->sql , $ case ->bindings )
7092+ ->select ($ case ->sql , $ case ->bindings )
70987093 ->build ();
70997094 $ this ->assertBindingCount ($ result );
71007095
@@ -7104,7 +7099,7 @@ public function testSelectRawWithCaseExpression(): void
71047099
71057100 public function testSelectRawResetClears (): void
71067101 {
7107- $ builder = (new Builder ())->from ('t ' )->selectRaw ('1 AS one ' );
7102+ $ builder = (new Builder ())->from ('t ' )->select ('1 AS one ' );
71087103 $ builder ->build ();
71097104 $ builder ->reset ();
71107105
@@ -7143,8 +7138,8 @@ public function testMultipleSelectRaw(): void
71437138 {
71447139 $ result = (new Builder ())
71457140 ->from ('t ' )
7146- ->selectRaw ('COUNT(*) AS cnt ' )
7147- ->selectRaw ('MAX(price) AS max_price ' )
7141+ ->select ('COUNT(*) AS cnt ' )
7142+ ->select ('MAX(price) AS max_price ' )
71487143 ->build ();
71497144 $ this ->assertBindingCount ($ result );
71507145
@@ -9057,7 +9052,7 @@ public function testSelectRawWithRegularSelect(): void
90579052 $ result = (new Builder ())
90589053 ->from ('t ' )
90599054 ->select (['id ' ])
9060- ->selectRaw ('NOW() as current_time ' )
9055+ ->select ('NOW() as current_time ' )
90619056 ->build ();
90629057 $ this ->assertBindingCount ($ result );
90639058
@@ -9068,7 +9063,7 @@ public function testSelectRawWithBindings2(): void
90689063 {
90699064 $ result = (new Builder ())
90709065 ->from ('t ' )
9071- ->selectRaw ('COALESCE(?, ?) as result ' , ['a ' , 'b ' ])
9066+ ->select ('COALESCE(?, ?) as result ' , ['a ' , 'b ' ])
90729067 ->build ();
90739068 $ this ->assertBindingCount ($ result );
90749069
@@ -9153,7 +9148,7 @@ public function testFilterWithRawCombined(): void
91539148
91549149 public function testResetClearsRawSelects2 (): void
91559150 {
9156- $ builder = (new Builder ())->from ('t ' )->selectRaw ('1 AS one ' );
9151+ $ builder = (new Builder ())->from ('t ' )->select ('1 AS one ' );
91579152 $ builder ->build ();
91589153 $ builder ->reset ();
91599154
@@ -9911,7 +9906,7 @@ public function testSubqueryBindingOrderIsCorrect(): void
99119906 public function testSelectSubBindingOrder (): void
99129907 {
99139908 $ sub = (new Builder ())->from ('orders ' )
9914- ->selectRaw ('COUNT(*) ' )
9909+ ->select ('COUNT(*) ' )
99159910 ->filter ([Query::equal ('orders.user_id ' , ['matched ' ])]);
99169911
99179912 $ result = (new Builder ())
@@ -10718,8 +10713,8 @@ public function testExactRawExpressions(): void
1071810713 {
1071910714 $ result = (new Builder ())
1072010715 ->from ('users ' )
10721- ->selectRaw ('COUNT(*) AS `total` ' )
10722- ->selectRaw ('MAX(`created_at`) AS `latest` ' )
10716+ ->select ('COUNT(*) AS `total` ' )
10717+ ->select ('MAX(`created_at`) AS `latest` ' )
1072310718 ->filter ([Query::equal ('active ' , [true ])])
1072410719 ->orderByRaw ('FIELD(`role`, ?, ?, ?) ' , ['admin ' , 'editor ' , 'viewer ' ])
1072510720 ->build ();
@@ -10816,7 +10811,7 @@ public function testExactSelectSubquery(): void
1081610811 {
1081710812 $ sub = (new Builder ())
1081810813 ->from ('orders ' )
10819- ->selectRaw ('COUNT(*) ' )
10814+ ->select ('COUNT(*) ' )
1082010815 ->filter ([Query::raw ('`orders`.`user_id` = `users`.`id` ' )]);
1082110816
1082210817 $ result = (new Builder ())
@@ -11265,8 +11260,8 @@ public function testExactAdvancedSelectRawWithGroupByRawAndHavingRaw(): void
1126511260 {
1126611261 $ result = (new Builder ())
1126711262 ->from ('orders ' )
11268- ->selectRaw ('DATE(`created_at`) AS `order_date` ' )
11269- ->selectRaw ('SUM(`total`) AS `daily_total` ' )
11263+ ->select ('DATE(`created_at`) AS `order_date` ' )
11264+ ->select ('SUM(`total`) AS `daily_total` ' )
1127011265 ->groupByRaw ('DATE(`created_at`) ' )
1127111266 ->havingRaw ('SUM(`total`) > ? ' , [1000 ])
1127211267 ->build ();
@@ -11717,8 +11712,8 @@ public function testResetClearsUpdateJoinAndDeleteUsing(): void
1171711712 public function testFromNone (): void
1171811713 {
1171911714 $ result = (new Builder ())
11720- ->fromNone ()
11721- ->selectRaw ('1 AS one ' )
11715+ ->from ()
11716+ ->select ('1 AS one ' )
1172211717 ->build ();
1172311718 $ this ->assertBindingCount ($ result );
1172411719
@@ -11790,8 +11785,8 @@ public function testNaturalJoinWithAlias(): void
1179011785
1179111786 public function testWithRecursiveSeedStep (): void
1179211787 {
11793- $ seed = (new Builder ())->fromNone ()->selectRaw ('1 AS n ' );
11794- $ step = (new Builder ())->from ('cte ' )->selectRaw ('n + 1 ' )->filter ([Query::lessThan ('n ' , 10 )]);
11788+ $ seed = (new Builder ())->from ()->select ('1 AS n ' );
11789+ $ step = (new Builder ())->from ('cte ' )->select ('n + 1 ' )->filter ([Query::lessThan ('n ' , 10 )]);
1179511790 $ result = (new Builder ())
1179611791 ->from ('cte ' )
1179711792 ->withRecursiveSeedStep ('cte ' , $ seed , $ step )
@@ -11917,7 +11912,7 @@ public function testFilterNotExistsSubquery(): void
1191711912
1191811913 public function testSelectSubquery (): void
1191911914 {
11920- $ sub = (new Builder ())->fromNone ()->selectRaw ('COUNT(*) ' );
11915+ $ sub = (new Builder ())->from ()->select ('COUNT(*) ' );
1192111916 $ result = (new Builder ())
1192211917 ->from ('users ' )
1192311918 ->select (['name ' ])
@@ -12760,8 +12755,8 @@ public function testCloneWithLateralJoins(): void
1276012755 public function testValidateTableFromNone (): void
1276112756 {
1276212757 $ result = (new Builder ())
12763- ->fromNone ()
12764- ->selectRaw ('CONNECTION_ID() AS cid ' )
12758+ ->from ()
12759+ ->select ('CONNECTION_ID() AS cid ' )
1276512760 ->build ();
1276612761 $ this ->assertBindingCount ($ result );
1276712762
@@ -13879,7 +13874,7 @@ public function testSelectRawWithBindingsPlusRegularSelect(): void
1387913874 $ result = (new Builder ())
1388013875 ->from ('t ' )
1388113876 ->select (['name ' ])
13882- ->selectRaw ('COALESCE(bio, ?) AS bio_display ' , ['N/A ' ])
13877+ ->select ('COALESCE(bio, ?) AS bio_display ' , ['N/A ' ])
1388313878 ->filter ([Query::equal ('active ' , [true ])])
1388413879 ->build ();
1388513880 $ this ->assertBindingCount ($ result );
@@ -14121,8 +14116,8 @@ public function testJoinWhereWithMultipleConditions(): void
1412114116 public function testFromNoneWithSelectRaw (): void
1412214117 {
1412314118 $ result = (new Builder ())
14124- ->fromNone ()
14125- ->selectRaw ('1 + 1 AS result ' )
14119+ ->from ()
14120+ ->select ('1 + 1 AS result ' )
1412614121 ->build ();
1412714122 $ this ->assertBindingCount ($ result );
1412814123
@@ -14529,9 +14524,9 @@ public function testMultipleSelectRawExpressions(): void
1452914524 {
1453014525 $ result = (new Builder ())
1453114526 ->from ('t ' )
14532- ->selectRaw ('NOW() AS current_time ' )
14533- ->selectRaw ('CONCAT(first_name, ?, last_name) AS full_name ' , [' ' ])
14534- ->selectRaw ('? AS constant_val ' , [42 ])
14527+ ->select ('NOW() AS current_time ' )
14528+ ->select ('CONCAT(first_name, ?, last_name) AS full_name ' , [' ' ])
14529+ ->select ('? AS constant_val ' , [42 ])
1453514530 ->build ();
1453614531 $ this ->assertBindingCount ($ result );
1453714532
@@ -14580,12 +14575,12 @@ public function testExistsAndNotExistsCombined(): void
1458014575 {
1458114576 $ existsSub = (new Builder ())
1458214577 ->from ('orders ' )
14583- ->selectRaw ('1 ' )
14578+ ->select ('1 ' )
1458414579 ->filter ([Query::raw ('orders.user_id = users.id ' )]);
1458514580
1458614581 $ notExistsSub = (new Builder ())
1458714582 ->from ('bans ' )
14588- ->selectRaw ('1 ' )
14583+ ->select ('1 ' )
1458914584 ->filter ([Query::raw ('bans.user_id = users.id ' )]);
1459014585
1459114586 $ result = (new Builder ())
0 commit comments