44
55use Doctrine \DBAL \Schema \Schema ;
66use Doctrine \DBAL \Types \Type ;
7+ use Doctrine \DBAL \Types \Types ;
78use PHPUnit \Framework \TestCase ;
89
910class TdbmFluidColumnTest extends TestCase
@@ -20,95 +21,90 @@ public function testTypes()
2021 $ dbalColumn = $ schema ->getTable ('posts ' )->getColumn ('foo ' );
2122
2223 $ column ->integer ();
23- $ this ->assertSame (Type::getType (Type ::INTEGER ), $ dbalColumn ->getType ());
24+ $ this ->assertSame (Type::getType (Types ::INTEGER ), $ dbalColumn ->getType ());
2425
2526 $ column ->smallInt ();
26- $ this ->assertSame (Type::getType (Type ::SMALLINT ), $ dbalColumn ->getType ());
27+ $ this ->assertSame (Type::getType (Types ::SMALLINT ), $ dbalColumn ->getType ());
2728
2829 $ column ->bigInt ();
29- $ this ->assertSame (Type::getType (Type ::BIGINT ), $ dbalColumn ->getType ());
30+ $ this ->assertSame (Type::getType (Types ::BIGINT ), $ dbalColumn ->getType ());
3031
3132 $ column ->decimal (12 , 32 );
32- $ this ->assertSame (Type::getType (Type ::DECIMAL ), $ dbalColumn ->getType ());
33+ $ this ->assertSame (Type::getType (Types ::DECIMAL ), $ dbalColumn ->getType ());
3334 $ this ->assertSame (12 , $ dbalColumn ->getPrecision ());
3435 $ this ->assertSame (32 , $ dbalColumn ->getScale ());
3536
3637 $ column ->float (32 , 12 );
37- $ this ->assertSame (Type::getType (Type ::FLOAT ), $ dbalColumn ->getType ());
38+ $ this ->assertSame (Type::getType (Types ::FLOAT ), $ dbalColumn ->getType ());
3839 $ this ->assertSame (32 , $ dbalColumn ->getPrecision ());
3940 $ this ->assertSame (12 , $ dbalColumn ->getScale ());
4041
4142 $ column ->string (42 , true );
42- $ this ->assertSame (Type::getType (Type ::STRING ), $ dbalColumn ->getType ());
43+ $ this ->assertSame (Type::getType (Types ::STRING ), $ dbalColumn ->getType ());
4344 $ this ->assertSame (42 , $ dbalColumn ->getLength ());
4445 $ this ->assertSame (true , $ dbalColumn ->getFixed ());
4546
4647 $ column ->text ();
47- $ this ->assertSame (Type::getType (Type ::TEXT ), $ dbalColumn ->getType ());
48+ $ this ->assertSame (Type::getType (Types ::TEXT ), $ dbalColumn ->getType ());
4849
4950 $ column ->guid ();
50- $ this ->assertSame (Type::getType (Type ::GUID ), $ dbalColumn ->getType ());
51+ $ this ->assertSame (Type::getType (Types ::GUID ), $ dbalColumn ->getType ());
5152
5253 $ column ->blob ();
53- $ this ->assertSame (Type::getType (Type ::BLOB ), $ dbalColumn ->getType ());
54+ $ this ->assertSame (Type::getType (Types ::BLOB ), $ dbalColumn ->getType ());
5455
5556 $ column ->boolean ();
56- $ this ->assertSame (Type::getType (Type ::BOOLEAN ), $ dbalColumn ->getType ());
57+ $ this ->assertSame (Type::getType (Types ::BOOLEAN ), $ dbalColumn ->getType ());
5758
5859 $ column ->date ();
59- $ this ->assertSame (Type::getType (Type:: DATE ), $ dbalColumn ->getType ());
60+ $ this ->assertSame (Type::getType (Types:: DATE_MUTABLE ), $ dbalColumn ->getType ());
6061
6162 $ column ->datetime ();
62- $ this ->assertSame (Type::getType (Type:: DATETIME ), $ dbalColumn ->getType ());
63+ $ this ->assertSame (Type::getType (Types:: DATETIME_MUTABLE ), $ dbalColumn ->getType ());
6364
6465 $ column ->datetimeTz ();
65- $ this ->assertSame (Type::getType (Type:: DATETIMETZ ), $ dbalColumn ->getType ());
66+ $ this ->assertSame (Type::getType (Types:: DATETIMETZ_MUTABLE ), $ dbalColumn ->getType ());
6667
6768 $ column ->time ();
68- $ this ->assertSame (Type::getType (Type:: TIME ), $ dbalColumn ->getType ());
69+ $ this ->assertSame (Type::getType (Types:: TIME_MUTABLE ), $ dbalColumn ->getType ());
6970
7071 $ column ->array ();
71- $ this ->assertSame (Type::getType (Type:: TARRAY ), $ dbalColumn ->getType ());
72+ $ this ->assertSame (Type::getType (Types:: ARRAY ), $ dbalColumn ->getType ());
7273
7374 $ column ->simpleArray ();
74- $ this ->assertSame (Type::getType (Type ::SIMPLE_ARRAY ), $ dbalColumn ->getType ());
75+ $ this ->assertSame (Type::getType (Types ::SIMPLE_ARRAY ), $ dbalColumn ->getType ());
7576
7677 $ column ->jsonArray ();
77- $ this ->assertSame (Type::getType (Type:: JSON_ARRAY ), $ dbalColumn ->getType ());
78+ $ this ->assertSame (Type::getType (Types:: JSON ), $ dbalColumn ->getType ());
7879
7980 $ column ->object ();
80- $ this ->assertSame (Type::getType (Type ::OBJECT ), $ dbalColumn ->getType ());
81+ $ this ->assertSame (Type::getType (Types ::OBJECT ), $ dbalColumn ->getType ());
8182
82- if (defined ('Doctrine \\DBAL \\Types \\Type::BINARY ' )) {
83- $ column ->binary (43 );
84- $ this ->assertSame (Type::getType (Type::BINARY ), $ dbalColumn ->getType ());
85- $ this ->assertSame (43 , $ dbalColumn ->getLength ());
86- $ this ->assertSame (false , $ dbalColumn ->getFixed ());
87- }
83+ $ column ->binary (43 );
84+ $ this ->assertSame (Type::getType (Types::BINARY ), $ dbalColumn ->getType ());
85+ $ this ->assertSame (43 , $ dbalColumn ->getLength ());
86+ $ this ->assertSame (false , $ dbalColumn ->getFixed ());
8887
89- if (defined ('Doctrine \\DBAL \\Types \\Type::DATE_IMMUTABLE ' )) {
90- // Doctrine DBAL 2.6+
91- $ column ->dateImmutable ();
92- $ this ->assertSame (Type::getType ('date_immutable ' ), $ dbalColumn ->getType ());
88+ $ column ->dateImmutable ();
89+ $ this ->assertSame (Type::getType ('date_immutable ' ), $ dbalColumn ->getType ());
9390
94- $ column ->datetimeImmutable ();
95- $ this ->assertSame (Type::getType (Type ::DATETIME_IMMUTABLE ), $ dbalColumn ->getType ());
91+ $ column ->datetimeImmutable ();
92+ $ this ->assertSame (Type::getType (Types ::DATETIME_IMMUTABLE ), $ dbalColumn ->getType ());
9693
97- $ column ->datetimeTzImmutable ();
98- $ this ->assertSame (Type::getType (Type ::DATETIMETZ_IMMUTABLE ), $ dbalColumn ->getType ());
94+ $ column ->datetimeTzImmutable ();
95+ $ this ->assertSame (Type::getType (Types ::DATETIMETZ_IMMUTABLE ), $ dbalColumn ->getType ());
9996
100- $ column ->time ();
101- $ this ->assertSame (Type::getType (Type:: TIME ), $ dbalColumn ->getType ());
97+ $ column ->time ();
98+ $ this ->assertSame (Type::getType (Types:: TIME_MUTABLE ), $ dbalColumn ->getType ());
10299
103- $ column ->timeImmutable ();
104- $ this ->assertSame (Type::getType (Type ::TIME_IMMUTABLE ), $ dbalColumn ->getType ());
100+ $ column ->timeImmutable ();
101+ $ this ->assertSame (Type::getType (Types ::TIME_IMMUTABLE ), $ dbalColumn ->getType ());
105102
106- $ column ->dateInterval ();
107- $ this ->assertSame (Type::getType (Type ::DATEINTERVAL ), $ dbalColumn ->getType ());
103+ $ column ->dateInterval ();
104+ $ this ->assertSame (Type::getType (Types ::DATEINTERVAL ), $ dbalColumn ->getType ());
108105
109- $ column ->json ();
110- $ this ->assertSame (Type::getType (Type::JSON ), $ dbalColumn ->getType ());
111- }
106+ $ column ->json ();
107+ $ this ->assertSame (Type::getType (Types::JSON ), $ dbalColumn ->getType ());
112108
113109 $ this ->assertSame ('foo ' , $ column ->getDbalColumn ()->getName ());
114110 }
@@ -126,7 +122,7 @@ public function testReference()
126122
127123 $ dbalColumn = $ schema ->getTable ('users ' )->getColumn ('country_id ' );
128124
129- $ this ->assertSame (Type::getType (Type ::INTEGER ), $ dbalColumn ->getType ());
125+ $ this ->assertSame (Type::getType (Types ::INTEGER ), $ dbalColumn ->getType ());
130126 $ fk = $ schema ->getTable ('users ' )->getForeignKey ('myfk ' );
131127 $ this ->assertSame ('users ' , $ fk ->getLocalTableName ());
132128 $ this ->assertSame ('countries ' , $ fk ->getForeignTableName ());
0 commit comments