Skip to content

Commit 41f6727

Browse files
chore: refactor the integrations TestCases with more extensible logic through runDbalBindingRoundTrip() (#427)
1 parent c4f4574 commit 41f6727

18 files changed

+92
-61
lines changed

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/ArrayTypeTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function can_handle_empty_array(): void
1414
$typeName = $this->getTypeName();
1515
$columnType = $this->getPostgresTypeName();
1616

17-
$this->runTypeTest($typeName, $columnType, []);
17+
$this->runDbalBindingRoundTrip($typeName, $columnType, []);
1818
}
1919

2020
#[Test]
@@ -23,7 +23,7 @@ public function can_handle_null_values(): void
2323
$typeName = $this->getTypeName();
2424
$columnType = $this->getPostgresTypeName();
2525

26-
$this->runTypeTest($typeName, $columnType, null);
26+
$this->runDbalBindingRoundTrip($typeName, $columnType, null);
2727
}
2828

2929
/**
@@ -35,6 +35,6 @@ public function can_handle_array_values(string $testName, array $arrayValue): vo
3535
$typeName = $this->getTypeName();
3636
$columnType = $this->getPostgresTypeName();
3737

38-
$this->runTypeTest($typeName, $columnType, $arrayValue);
38+
$this->runDbalBindingRoundTrip($typeName, $columnType, $arrayValue);
3939
}
4040
}

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/CidrArrayTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ public function can_handle_invalid_networks(): void
5858
$typeName = $this->getTypeName();
5959
$columnType = $this->getPostgresTypeName();
6060

61-
$this->runTypeTest($typeName, $columnType, ['invalid-network', '192.168.1.0/24']);
61+
$this->runDbalBindingRoundTrip($typeName, $columnType, ['invalid-network', '192.168.1.0/24']);
6262
}
6363
}

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/CidrTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function can_transform_from_php_value(string $testValue): void
2727
$typeName = $this->getTypeName();
2828
$columnType = $this->getPostgresTypeName();
2929

30-
$this->runTypeTest($typeName, $columnType, $testValue);
30+
$this->runDbalBindingRoundTrip($typeName, $columnType, $testValue);
3131
}
3232

3333
/**
@@ -53,6 +53,6 @@ public function can_handle_invalid_networks(): void
5353
$typeName = $this->getTypeName();
5454
$columnType = $this->getPostgresTypeName();
5555

56-
$this->runTypeTest($typeName, $columnType, 'invalid-network');
56+
$this->runDbalBindingRoundTrip($typeName, $columnType, 'invalid-network');
5757
}
5858
}

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/DateRangeTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function can_handle_infinite_ranges(): void
6868
$columnType = $this->getPostgresTypeName();
6969

7070
$dateRange = new DateRangeValueObject(null, null, false, false);
71-
$this->runTypeTest($typeName, $columnType, $dateRange);
71+
$this->runDbalBindingRoundTrip($typeName, $columnType, $dateRange);
7272
}
7373

7474
#[Test]
@@ -84,7 +84,7 @@ public function can_handle_empty_ranges(): void
8484
false,
8585
false
8686
);
87-
$this->runTypeTest($typeName, $columnType, $dateRange);
87+
$this->runDbalBindingRoundTrip($typeName, $columnType, $dateRange);
8888
}
8989

9090
/**

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/InetArrayTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ public function can_handle_invalid_addresses(): void
5757
$typeName = $this->getTypeName();
5858
$columnType = $this->getPostgresTypeName();
5959

60-
$this->runTypeTest($typeName, $columnType, ['invalid-address', '192.168.1.1']);
60+
$this->runDbalBindingRoundTrip($typeName, $columnType, ['invalid-address', '192.168.1.1']);
6161
}
6262
}

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/InetTypeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function can_transform_from_php_value(string $testValue): void
2727
$typeName = $this->getTypeName();
2828
$columnType = $this->getPostgresTypeName();
2929

30-
$this->runTypeTest($typeName, $columnType, $testValue);
30+
$this->runDbalBindingRoundTrip($typeName, $columnType, $testValue);
3131
}
3232

3333
/**
@@ -53,7 +53,7 @@ public function can_handle_invalid_addresses(): void
5353
$typeName = $this->getTypeName();
5454
$columnType = $this->getPostgresTypeName();
5555

56-
$this->runTypeTest($typeName, $columnType, 'invalid-address');
56+
$this->runDbalBindingRoundTrip($typeName, $columnType, 'invalid-address');
5757
}
5858

5959
#[Test]
@@ -64,6 +64,6 @@ public function can_handle_empty_string(): void
6464
$typeName = $this->getTypeName();
6565
$columnType = $this->getPostgresTypeName();
6666

67-
$this->runTypeTest($typeName, $columnType, '');
67+
$this->runDbalBindingRoundTrip($typeName, $columnType, '');
6868
}
6969
}

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/Int4RangeTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function can_handle_infinite_ranges(): void
4848
$columnType = $this->getPostgresTypeName();
4949

5050
$int4Range = new Int4RangeValueObject(null, null, false, false);
51-
$this->runTypeTest($typeName, $columnType, $int4Range);
51+
$this->runDbalBindingRoundTrip($typeName, $columnType, $int4Range);
5252
}
5353

5454
#[Test]
@@ -59,7 +59,7 @@ public function can_handle_empty_ranges(): void
5959

6060
// lower > upper shall result in an empty range
6161
$int4Range = new Int4RangeValueObject(10, 5, false, false);
62-
$this->runTypeTest($typeName, $columnType, $int4Range);
62+
$this->runDbalBindingRoundTrip($typeName, $columnType, $int4Range);
6363
}
6464

6565
/**

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/Int8RangeTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function can_handle_infinite_ranges(): void
4848
$columnType = $this->getPostgresTypeName();
4949

5050
$int8Range = new Int8RangeValueObject(null, null, false, false);
51-
$this->runTypeTest($typeName, $columnType, $int8Range);
51+
$this->runDbalBindingRoundTrip($typeName, $columnType, $int8Range);
5252
}
5353

5454
#[Test]
@@ -59,7 +59,7 @@ public function can_handle_empty_ranges(): void
5959

6060
// lower > upper shall result in an empty range
6161
$int8Range = new Int8RangeValueObject(10, 5, false, false);
62-
$this->runTypeTest($typeName, $columnType, $int8Range);
62+
$this->runDbalBindingRoundTrip($typeName, $columnType, $int8Range);
6363
}
6464

6565
/**

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/JsonbTypeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function can_handle_null_values(): void
2525
$typeName = $this->getTypeName();
2626
$columnType = $this->getPostgresTypeName();
2727

28-
$this->runTypeTest($typeName, $columnType, null);
28+
$this->runDbalBindingRoundTrip($typeName, $columnType, null);
2929
}
3030

3131
#[Test]
@@ -34,7 +34,7 @@ public function can_handle_empty_arrays(): void
3434
$typeName = $this->getTypeName();
3535
$columnType = $this->getPostgresTypeName();
3636

37-
$this->runTypeTest($typeName, $columnType, []);
37+
$this->runDbalBindingRoundTrip($typeName, $columnType, []);
3838
}
3939

4040
#[DataProvider('provideValidTransformations')]
@@ -44,7 +44,7 @@ public function can_handle_json_values(string $testName, array $json): void
4444
$typeName = $this->getTypeName();
4545
$columnType = $this->getPostgresTypeName();
4646

47-
$this->runTypeTest($typeName, $columnType, $json);
47+
$this->runDbalBindingRoundTrip($typeName, $columnType, $json);
4848
}
4949

5050
/**

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/MacaddrArrayTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ public function can_handle_invalid_addresses(): void
5555
$typeName = $this->getTypeName();
5656
$columnType = $this->getPostgresTypeName();
5757

58-
$this->runTypeTest($typeName, $columnType, ['invalid-mac', '08:00:2b:01:02:03']);
58+
$this->runDbalBindingRoundTrip($typeName, $columnType, ['invalid-mac', '08:00:2b:01:02:03']);
5959
}
6060
}

0 commit comments

Comments
 (0)