Skip to content

Commit a02223f

Browse files
committed
Fix unneeded consts in UtilTest
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 4342b42 commit a02223f

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

test/classes/UniqueConditionTest.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@
2020
use const MYSQLI_TYPE_LONG;
2121
use const MYSQLI_TYPE_SHORT;
2222
use const MYSQLI_TYPE_STRING;
23+
use const MYSQLI_TYPE_TINY;
24+
use const MYSQLI_TYPE_VAR_STRING;
2325
use const MYSQLI_UNIQUE_KEY_FLAG;
2426

25-
const FIELD_TYPE_INTEGER = 1;
26-
const FIELD_TYPE_VARCHAR = 253;
27-
const FIELD_TYPE_UNKNOWN = -1;
28-
2927
#[CoversClass(UniqueCondition::class)]
3028
class UniqueConditionTest extends AbstractTestCase
3129
{
@@ -286,7 +284,7 @@ public static function providerGetUniqueConditionForGroupFlag(): array
286284
'field type is integer, value is number - not escape string' => [
287285
[
288286
FieldHelper::fromArray([
289-
'type' => FIELD_TYPE_INTEGER,
287+
'type' => MYSQLI_TYPE_TINY,
290288
'flags' => MYSQLI_NUM_FLAG,
291289
'name' => 'col',
292290
'table' => 'table',
@@ -299,7 +297,7 @@ public static function providerGetUniqueConditionForGroupFlag(): array
299297
'field type is unknown, value is string - escape string' => [
300298
[
301299
FieldHelper::fromArray([
302-
'type' => FIELD_TYPE_UNKNOWN,
300+
'type' => -1,
303301
'flags' => MYSQLI_NUM_FLAG,
304302
'name' => 'col',
305303
'table' => 'table',
@@ -312,7 +310,7 @@ public static function providerGetUniqueConditionForGroupFlag(): array
312310
'field type is varchar, value is string - escape string' => [
313311
[
314312
FieldHelper::fromArray([
315-
'type' => FIELD_TYPE_VARCHAR,
313+
'type' => MYSQLI_TYPE_VAR_STRING,
316314
'flags' => MYSQLI_NUM_FLAG,
317315
'name' => 'col',
318316
'table' => 'table',
@@ -325,7 +323,7 @@ public static function providerGetUniqueConditionForGroupFlag(): array
325323
'field type is varchar, value is string with double quote - escape string' => [
326324
[
327325
FieldHelper::fromArray([
328-
'type' => FIELD_TYPE_VARCHAR,
326+
'type' => MYSQLI_TYPE_VAR_STRING,
329327
'flags' => MYSQLI_NUM_FLAG,
330328
'name' => 'col',
331329
'table' => 'table',
@@ -338,7 +336,7 @@ public static function providerGetUniqueConditionForGroupFlag(): array
338336
'field type is varchar, value is string with single quote - escape string' => [
339337
[
340338
FieldHelper::fromArray([
341-
'type' => FIELD_TYPE_VARCHAR,
339+
'type' => MYSQLI_TYPE_VAR_STRING,
342340
'flags' => MYSQLI_NUM_FLAG,
343341
'name' => 'col',
344342
'table' => 'table',
@@ -351,14 +349,14 @@ public static function providerGetUniqueConditionForGroupFlag(): array
351349
'group by multiple columns and field type is mixed' => [
352350
[
353351
FieldHelper::fromArray([
354-
'type' => FIELD_TYPE_VARCHAR,
352+
'type' => MYSQLI_TYPE_VAR_STRING,
355353
'flags' => MYSQLI_NUM_FLAG,
356354
'name' => 'col',
357355
'table' => 'table',
358356
'orgtable' => 'table',
359357
]),
360358
FieldHelper::fromArray([
361-
'type' => FIELD_TYPE_INTEGER,
359+
'type' => MYSQLI_TYPE_TINY,
362360
'flags' => MYSQLI_NUM_FLAG,
363361
'name' => 'status_id',
364362
'table' => 'table',

test/classes/UtilTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
use const LC_ALL;
3535
use const LOCALE_PATH;
3636

37-
const FIELD_TYPE_INTEGER = 1;
38-
const FIELD_TYPE_VARCHAR = 253;
39-
const FIELD_TYPE_UNKNOWN = -1;
40-
4137
#[CoversClass(Util::class)]
4238
class UtilTest extends AbstractTestCase
4339
{

0 commit comments

Comments
 (0)