@@ -44,15 +44,15 @@ public function testChunk(): void
4444 public function testChunkThrowsOnZeroSize (): void
4545 {
4646 $ this ->expectException (InvalidArgumentException::class);
47- $ this ->expectExceptionMessage ('chunk() requires a positive integer for the $size argument . ' );
47+ $ this ->expectExceptionMessage ('$size must be a positive integer. ' );
4848
4949 $ this ->createModel (UserModel::class)->chunk (0 , static function ($ row ): void {});
5050 }
5151
5252 public function testChunkThrowsOnNegativeSize (): void
5353 {
5454 $ this ->expectException (InvalidArgumentException::class);
55- $ this ->expectExceptionMessage ('chunk() requires a positive integer for the $size argument . ' );
55+ $ this ->expectExceptionMessage ('$size must be a positive integer. ' );
5656
5757 $ this ->createModel (UserModel::class)->chunk (-1 , static function ($ row ): void {});
5858 }
@@ -97,12 +97,12 @@ public function testChunkEmptyTable(): void
9797 $ this ->assertSame (0 , $ rowCount );
9898 }
9999
100- public function testChunkArray (): void
100+ public function testChunkRows (): void
101101 {
102102 $ chunkCount = 0 ;
103103 $ numRowsInChunk = [];
104104
105- $ this ->createModel (UserModel::class)->chunkArray (2 , static function ($ rows ) use (&$ chunkCount , &$ numRowsInChunk ): void {
105+ $ this ->createModel (UserModel::class)->chunkRows (2 , static function ($ rows ) use (&$ chunkCount , &$ numRowsInChunk ): void {
106106 $ chunkCount ++;
107107 $ numRowsInChunk [] = count ($ rows );
108108 });
@@ -111,27 +111,27 @@ public function testChunkArray(): void
111111 $ this ->assertSame ([2 , 2 ], $ numRowsInChunk );
112112 }
113113
114- public function testChunkArrayThrowsOnZeroSize (): void
114+ public function testChunkRowsThrowsOnZeroSize (): void
115115 {
116116 $ this ->expectException (InvalidArgumentException::class);
117- $ this ->expectExceptionMessage ('chunkArray() requires a positive integer for the $size argument . ' );
117+ $ this ->expectExceptionMessage ('$size must be a positive integer. ' );
118118
119- $ this ->createModel (UserModel::class)->chunkArray (0 , static function ($ row ): void {});
119+ $ this ->createModel (UserModel::class)->chunkRows (0 , static function ($ row ): void {}); ;
120120 }
121121
122- public function testChunkArrayThrowsOnNegativeSize (): void
122+ public function testChunkRowsThrowsOnNegativeSize (): void
123123 {
124124 $ this ->expectException (InvalidArgumentException::class);
125- $ this ->expectExceptionMessage ('chunkArray() requires a positive integer for the $size argument . ' );
125+ $ this ->expectExceptionMessage ('$size must be a positive integer. ' );
126126
127- $ this ->createModel (UserModel::class)->chunkArray (-1 , static function ($ row ): void {});
127+ $ this ->createModel (UserModel::class)->chunkRows (-1 , static function ($ row ): void {});
128128 }
129129
130- public function testChunkArrayEarlyExit (): void
130+ public function testChunkRowsEarlyExit (): void
131131 {
132132 $ rowCount = 0 ;
133133
134- $ this ->createModel (UserModel::class)->chunkArray (2 , static function ($ rows ) use (&$ rowCount ): bool {
134+ $ this ->createModel (UserModel::class)->chunkRows (2 , static function ($ rows ) use (&$ rowCount ): bool {
135135 $ rowCount ++;
136136
137137 return false ;
@@ -140,27 +140,27 @@ public function testChunkArrayEarlyExit(): void
140140 $ this ->assertSame (1 , $ rowCount );
141141 }
142142
143- public function testChunkArrayDoesNotRunExtraQuery (): void
143+ public function testChunkRowsDoesNotRunExtraQuery (): void
144144 {
145145 $ queryCount = 0 ;
146146 $ listener = static function () use (&$ queryCount ): void {
147147 $ queryCount ++;
148148 };
149149
150150 Events::on ('DBQuery ' , $ listener );
151- $ this ->createModel (UserModel::class)->chunkArray (4 , static function ($ rows ): void {});
151+ $ this ->createModel (UserModel::class)->chunkRows (4 , static function ($ rows ): void {});
152152 Events::removeListener ('DBQuery ' , $ listener );
153153
154154 $ this ->assertSame (2 , $ queryCount );
155155 }
156156
157- public function testChunkArrayEmptyTable (): void
157+ public function testChunkRowsEmptyTable (): void
158158 {
159159 $ this ->db ->table ('user ' )->truncate ();
160160
161161 $ rowCount = 0 ;
162162
163- $ this ->createModel (UserModel::class)->chunkArray (2 , static function ($ row ) use (&$ rowCount ): void {
163+ $ this ->createModel (UserModel::class)->chunkRows (2 , static function ($ row ) use (&$ rowCount ): void {
164164 $ rowCount ++;
165165 });
166166
0 commit comments