@@ -24,7 +24,7 @@ class CriteriaItemTest extends TestCase
2424 */
2525 final public static function provideComparisonOperators (): array
2626 {
27- $ column = sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX ));
27+ $ column = sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX ));
2828 $ specialOperators = [
2929 ComparisonOperator::BETWEEN ->name ,
3030 ComparisonOperator::NOT_BETWEEN ->name ,
@@ -33,7 +33,7 @@ final public static function provideComparisonOperators(): array
3333 ];
3434 $ possibleValues = [
3535 null , // null value
36- md5 (random_int (PHP_INT_MIN , PHP_INT_MAX )), // random string
36+ md5 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX )), // random string
3737 random_int (PHP_INT_MIN , PHP_INT_MAX ), // random int
3838 mt_rand () / mt_getrandmax (), // random float
3939 true , // true
@@ -142,7 +142,7 @@ final public static function provideOrder(): Generator
142142 #[DataProvider('provideOrder ' )]
143143 final public function testOrder (Order |string $ order ): void
144144 {
145- $ criteria = new CriteriaItem (sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX )));
145+ $ criteria = new CriteriaItem (sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX )));
146146 self ::assertSame (Order::ASC ->value , $ criteria ->getOrder ()->value , 'Default order is not correct ' );
147147 $ criteria ->setOrder ($ order );
148148 self ::assertSame (strtoupper (trim ($ order )), $ criteria ->getOrder ()->value , 'Order ' . $ order . ' does \'t sets ' );
@@ -155,9 +155,9 @@ final public function testOrder(Order|string $order): void
155155 */
156156 final public function testGroupBy (): void
157157 {
158- $ criteria = new CriteriaItem (sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX )));
158+ $ criteria = new CriteriaItem (sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX )));
159159 self ::assertEmpty ($ criteria ->getGroupBy (), 'Default group by is not empty ' );
160- $ groupBy = sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX ));
160+ $ groupBy = sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX ));
161161 $ criteria ->setGroupBy ($ groupBy );
162162 self ::assertNotEmpty ($ criteria ->getGroupBy (), 'Group by was set but value wasn \'t modified ' );
163163 self ::assertStringStartsWith ('GROUP BY ' , trim ($ criteria ->getGroupBy ()), 'Non empty group by doesn \' starts with "GROUP BY" ' );
@@ -170,9 +170,9 @@ final public function testGroupBy(): void
170170 */
171171 final public function testSortBy (): void
172172 {
173- $ criteria = new CriteriaItem (sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX )));
173+ $ criteria = new CriteriaItem (sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX )));
174174 self ::assertEmpty ($ criteria ->getSort (), 'Default sort by is not empty ' );
175- $ sort = sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX ));
175+ $ sort = sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX ));
176176 $ criteria ->setSort ($ sort );
177177 self ::assertNotEmpty ($ criteria ->getSort (), 'Sort by was set but value wasn \'t modified ' );
178178 self ::assertStringContainsString ($ sort , $ criteria ->getSort (), 'Sort by value doesn \'t exists ' );
@@ -184,7 +184,7 @@ final public function testSortBy(): void
184184 */
185185 final public function testPartialResults (): void
186186 {
187- $ criteria = new CriteriaItem (sha1 (random_int (PHP_INT_MIN , PHP_INT_MAX )));
187+ $ criteria = new CriteriaItem (sha1 (( string ) random_int (PHP_INT_MIN , PHP_INT_MAX )));
188188 self ::assertSame (0 , $ criteria ->getLimit (), 'Default limit is not 0 ' );
189189 self ::assertSame (0 , $ criteria ->getStart (), 'Default start is not 0 ' );
190190 $ limit = random_int (1 , PHP_INT_MAX );
0 commit comments