File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -260,9 +260,9 @@ if (! $diff->isEmpty()) {
260
260
}
261
261
```
262
262
263
- ## Deprecated not passing ` $fromColumn ` to the ` TableDiff ` constructor.
263
+ ## Deprecated not passing ` $fromTable ` to the ` TableDiff ` constructor.
264
264
265
- Not passing ` $fromColumn ` to the ` TableDiff ` constructor has been deprecated.
265
+ Not passing ` $fromTable ` to the ` TableDiff ` constructor has been deprecated.
266
266
267
267
The ` TableDiff::$name ` property and the ` TableDiff::getName() ` method have been deprecated as well. In order to obtain
268
268
the name of the table that the diff describes, use ` TableDiff::getOldTable() ` .
@@ -1002,7 +1002,7 @@ deprecated in order to provide a more consistent API.
1002
1002
1003
1003
## Deprecated ` Comparator::compare($fromSchema, $toSchema) `
1004
1004
1005
- The usage of ` Comparator::compare($fromSchema, $toSchema) ` is deprecated and
1005
+ The usage of ` Comparator::compare($fromSchema, $toSchema) ` is deprecated and
1006
1006
replaced by ` Comparator::compareSchemas($fromSchema, $toSchema) ` in order to
1007
1007
clarify the purpose of the method.
1008
1008
Original file line number Diff line number Diff line change @@ -180,11 +180,11 @@ public function __construct(
180
180
$ this ->changedForeignKeys = $ changedForeignKeys ;
181
181
$ this ->removedForeignKeys = $ removedForeignKeys ;
182
182
183
- if ($ fromTable ! == null ) {
183
+ if ($ fromTable = == null ) {
184
184
Deprecation::trigger (
185
185
'doctrine/dbal ' ,
186
186
'https://github.com/doctrine/dbal/pull/5678 ' ,
187
- 'Not passing the $fromColumn to %s is deprecated. ' ,
187
+ 'Not passing the $fromTable to %s is deprecated. ' ,
188
188
__METHOD__ ,
189
189
);
190
190
}
Original file line number Diff line number Diff line change 6
6
use Doctrine \DBAL \Schema \Identifier ;
7
7
use Doctrine \DBAL \Schema \Table ;
8
8
use Doctrine \DBAL \Schema \TableDiff ;
9
+ use Doctrine \Deprecations \PHPUnit \VerifyDeprecations ;
9
10
use PHPUnit \Framework \MockObject \MockObject ;
10
11
use PHPUnit \Framework \TestCase ;
11
12
12
13
class TableDiffTest extends TestCase
13
14
{
15
+ use VerifyDeprecations;
16
+
14
17
/** @var AbstractPlatform&MockObject */
15
18
private AbstractPlatform $ platform ;
16
19
@@ -53,4 +56,25 @@ public function testReturnsNewName(): void
53
56
54
57
self ::assertEquals (new Identifier ('bar ' ), $ tableDiff ->getNewName ());
55
58
}
59
+
60
+ public function testOmittingFromTableInConstructorIsDeprecated (): void
61
+ {
62
+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/dbal/pull/5678 ' );
63
+ $ tableDiff = new TableDiff ('foo ' );
64
+ }
65
+
66
+ public function testPassingFromTableToConstructorIsDeprecated (): void
67
+ {
68
+ $ this ->expectNoDeprecationWithIdentifier ('https://github.com/doctrine/dbal/pull/5678 ' );
69
+ $ tableDiff = new TableDiff (
70
+ 'foo ' ,
71
+ [],
72
+ [],
73
+ [],
74
+ [],
75
+ [],
76
+ [],
77
+ new Table ('foo ' ),
78
+ );
79
+ }
56
80
}
You can’t perform that action at this time.
0 commit comments