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 ;
@@ -90,9 +92,7 @@ public function testDropAndCreateSequence(): void
90
92
$ platform = $ this ->connection ->getDatabasePlatform ();
91
93
92
94
if (! $ platform ->supportsSequences ()) {
93
- self ::markTestSkipped (
94
- sprintf ('The "%s" platform does not support sequences. ' , $ platform ->getName ())
95
- );
95
+ self ::markTestSkipped ('The platform does not support sequences. ' );
96
96
}
97
97
98
98
$ name = 'dropcreate_sequences_test_seq ' ;
@@ -122,9 +122,7 @@ public function testListSequences(): void
122
122
$ platform = $ this ->connection ->getDatabasePlatform ();
123
123
124
124
if (! $ platform ->supportsSequences ()) {
125
- self ::markTestSkipped (
126
- sprintf ('The "%s" platform does not support sequences. ' , $ platform ->getName ())
127
- );
125
+ self ::markTestSkipped ('The platform does not support sequences. ' );
128
126
}
129
127
130
128
$ this ->schemaManager ->createSequence (
@@ -367,7 +365,7 @@ public function testListTableIndexesDispatchEvent(): void
367
365
*/
368
366
public function testDiffListTableColumns (callable $ comparatorFactory ): void
369
367
{
370
- if ($ this ->schemaManager ->getDatabasePlatform ()-> getName () === ' oracle ' ) {
368
+ if ($ this ->schemaManager ->getDatabasePlatform () instanceof OraclePlatform ) {
371
369
self ::markTestSkipped (
372
370
'Does not work with Oracle, since it cannot detect DateTime, Date and Time differences (at the moment). '
373
371
);
@@ -806,10 +804,12 @@ public function testRenameIndexUsedInForeignKeyConstraint(callable $comparatorFa
806
804
807
805
public function testGetColumnComment (): void
808
806
{
807
+ $ platform = $ this ->connection ->getDatabasePlatform ();
808
+
809
809
if (
810
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
811
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
812
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
810
+ ! $ platform ->supportsInlineColumnComments () &&
811
+ ! $ platform ->supportsCommentOnStatement () &&
812
+ ! $ platform instanceof SQLServerPlatform
813
813
) {
814
814
self ::markTestSkipped ('Database does not support column comments. ' );
815
815
}
@@ -849,10 +849,12 @@ public function testGetColumnComment(): void
849
849
850
850
public function testAutomaticallyAppendCommentOnMarkedColumns (): void
851
851
{
852
+ $ platform = $ this ->connection ->getDatabasePlatform ();
853
+
852
854
if (
853
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
854
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
855
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
855
+ ! $ platform ->supportsInlineColumnComments () &&
856
+ ! $ platform ->supportsCommentOnStatement () &&
857
+ ! $ platform instanceof SQLServerPlatform
856
858
) {
857
859
self ::markTestSkipped ('Database does not support column comments. ' );
858
860
}
@@ -876,10 +878,12 @@ public function testAutomaticallyAppendCommentOnMarkedColumns(): void
876
878
877
879
public function testCommentHintOnDateIntervalTypeColumn (): void
878
880
{
881
+ $ platform = $ this ->connection ->getDatabasePlatform ();
882
+
879
883
if (
880
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
881
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
882
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
884
+ ! $ platform ->supportsInlineColumnComments () &&
885
+ ! $ platform ->supportsCommentOnStatement () &&
886
+ ! $ platform instanceof SQLServerPlatform
883
887
) {
884
888
self ::markTestSkipped ('Database does not support column comments. ' );
885
889
}
@@ -1157,10 +1161,12 @@ public function testListTableDetailsWithFullQualifiedTableName(): void
1157
1161
1158
1162
public function testCommentStringsAreQuoted (): void
1159
1163
{
1164
+ $ platform = $ this ->connection ->getDatabasePlatform ();
1165
+
1160
1166
if (
1161
- ! $ this -> connection -> getDatabasePlatform () ->supportsInlineColumnComments () &&
1162
- ! $ this -> connection -> getDatabasePlatform () ->supportsCommentOnStatement () &&
1163
- $ this -> connection -> getDatabasePlatform ()-> getName () !== ' mssql '
1167
+ ! $ platform ->supportsInlineColumnComments () &&
1168
+ ! $ platform ->supportsCommentOnStatement () &&
1169
+ ! $ platform instanceof SQLServerPlatform
1164
1170
) {
1165
1171
self ::markTestSkipped ('Database does not support column comments. ' );
1166
1172
}
@@ -1222,7 +1228,7 @@ public function testAlterColumnComment(
1222
1228
if (
1223
1229
! $ platform ->supportsInlineColumnComments () &&
1224
1230
! $ platform ->supportsCommentOnStatement () &&
1225
- $ platform-> getName () !== ' mssql '
1231
+ ! $ platform instanceof SQLServerPlatform
1226
1232
) {
1227
1233
self ::markTestSkipped ('Database does not support column comments. ' );
1228
1234
}
0 commit comments