6
6
use Doctrine \DBAL \Events ;
7
7
use Doctrine \DBAL \Exception ;
8
8
use Doctrine \DBAL \Platforms \AbstractPlatform ;
9
+ use Doctrine \DBAL \Platforms \OraclePlatform ;
10
+ use Doctrine \DBAL \Platforms \SQLServerPlatform ;
9
11
use Doctrine \DBAL \Schema \AbstractAsset ;
10
12
use Doctrine \DBAL \Schema \AbstractSchemaManager ;
11
13
use Doctrine \DBAL \Schema \Column ;
@@ -89,9 +91,7 @@ public function testDropAndCreateSequence(): void
89
91
$ platform = $ this ->connection ->getDatabasePlatform ();
90
92
91
93
if (! $ platform ->supportsSequences ()) {
92
- self ::markTestSkipped (
93
- sprintf ('The "%s" platform does not support sequences. ' , $ platform ->getName ())
94
- );
94
+ self ::markTestSkipped ('The platform does not support sequences. ' );
95
95
}
96
96
97
97
$ name = 'dropcreate_sequences_test_seq ' ;
@@ -121,9 +121,7 @@ public function testListSequences(): void
121
121
$ platform = $ this ->connection ->getDatabasePlatform ();
122
122
123
123
if (! $ platform ->supportsSequences ()) {
124
- self ::markTestSkipped (
125
- sprintf ('The "%s" platform does not support sequences. ' , $ platform ->getName ())
126
- );
124
+ self ::markTestSkipped ('The platform does not support sequences. ' );
127
125
}
128
126
129
127
$ this ->schemaManager ->createSequence (
@@ -361,7 +359,7 @@ public function testListTableIndexesDispatchEvent(): void
361
359
362
360
public function testDiffListTableColumns (): void
363
361
{
364
- if ($ this ->schemaManager ->getDatabasePlatform ()-> getName () === ' oracle ' ) {
362
+ if ($ this ->schemaManager ->getDatabasePlatform () instanceof OraclePlatform ) {
365
363
self ::markTestSkipped (
366
364
'Does not work with Oracle, since it cannot detect DateTime, Date and Time differenecs (at the moment). '
367
365
);
@@ -781,10 +779,12 @@ public function testRenameIndexUsedInForeignKeyConstraint(): void
781
779
782
780
public function testGetColumnComment (): void
783
781
{
782
+ $ platform = $ this ->connection ->getDatabasePlatform ();
783
+
784
784
if (
785
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
786
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
787
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
785
+ ! $ platform ->supportsInlineColumnComments () &&
786
+ ! $ platform ->supportsCommentOnStatement () &&
787
+ ! $ platform instanceof SQLServerPlatform
788
788
) {
789
789
self ::markTestSkipped ('Database does not support column comments. ' );
790
790
}
@@ -824,10 +824,12 @@ public function testGetColumnComment(): void
824
824
825
825
public function testAutomaticallyAppendCommentOnMarkedColumns (): void
826
826
{
827
+ $ platform = $ this ->connection ->getDatabasePlatform ();
828
+
827
829
if (
828
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
829
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
830
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
830
+ ! $ platform ->supportsInlineColumnComments () &&
831
+ ! $ platform ->supportsCommentOnStatement () &&
832
+ ! $ platform instanceof SQLServerPlatform
831
833
) {
832
834
self ::markTestSkipped ('Database does not support column comments. ' );
833
835
}
@@ -851,10 +853,12 @@ public function testAutomaticallyAppendCommentOnMarkedColumns(): void
851
853
852
854
public function testCommentHintOnDateIntervalTypeColumn (): void
853
855
{
856
+ $ platform = $ this ->connection ->getDatabasePlatform ();
857
+
854
858
if (
855
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
856
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
857
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
859
+ ! $ platform ->supportsInlineColumnComments () &&
860
+ ! $ platform ->supportsCommentOnStatement () &&
861
+ ! $ platform instanceof SQLServerPlatform
858
862
) {
859
863
self ::markTestSkipped ('Database does not support column comments. ' );
860
864
}
@@ -1127,10 +1131,12 @@ public function testListTableDetailsWithFullQualifiedTableName(): void
1127
1131
1128
1132
public function testCommentStringsAreQuoted (): void
1129
1133
{
1134
+ $ platform = $ this ->connection ->getDatabasePlatform ();
1135
+
1130
1136
if (
1131
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
1132
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
1133
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
1137
+ ! $ platform ->supportsInlineColumnComments () &&
1138
+ ! $ platform ->supportsCommentOnStatement () &&
1139
+ ! $ platform instanceof SQLServerPlatform
1134
1140
) {
1135
1141
self ::markTestSkipped ('Database does not support column comments. ' );
1136
1142
}
@@ -1184,10 +1190,12 @@ public function testAlterColumnComment(
1184
1190
?string $ comment2 ,
1185
1191
?string $ expectedComment2
1186
1192
): void {
1193
+ $ platform = $ this ->connection ->getDatabasePlatform ();
1194
+
1187
1195
if (
1188
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
1189
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
1190
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
1196
+ ! $ platform ->supportsInlineColumnComments () &&
1197
+ ! $ platform ->supportsCommentOnStatement () &&
1198
+ ! $ platform instanceof SQLServerPlatform
1191
1199
) {
1192
1200
self ::markTestSkipped ('Database does not support column comments. ' );
1193
1201
}
0 commit comments