@@ -53,6 +53,7 @@ public function testBasicCreateTable()
53
53
54
54
$ conn = $ this ->getConnection ();
55
55
$ conn ->shouldReceive ('getConfig ' )->andReturn (null );
56
+ $ conn ->shouldReceive ('getServerVersion ' )->andReturn ('10.7.0 ' );
56
57
57
58
$ blueprint = new Blueprint ($ conn , 'users ' );
58
59
$ blueprint ->create ();
@@ -1118,17 +1119,36 @@ public function testAddingBinary()
1118
1119
1119
1120
public function testAddingUuid ()
1120
1121
{
1121
- $ blueprint = new Blueprint ($ this ->getConnection (), 'users ' );
1122
+ $ conn = $ this ->getConnection ();
1123
+ $ conn ->shouldReceive ('getServerVersion ' )->andReturn ('10.7.0 ' );
1124
+
1125
+ $ blueprint = new Blueprint ($ conn , 'users ' );
1122
1126
$ blueprint ->uuid ('foo ' );
1123
1127
$ statements = $ blueprint ->toSql ();
1124
1128
1125
1129
$ this ->assertCount (1 , $ statements );
1126
1130
$ this ->assertSame ('alter table `users` add `foo` uuid not null ' , $ statements [0 ]);
1127
1131
}
1128
1132
1133
+ public function testAddingUuidOn106 ()
1134
+ {
1135
+ $ conn = $ this ->getConnection ();
1136
+ $ conn ->shouldReceive ('getServerVersion ' )->andReturn ('10.6.21 ' );
1137
+
1138
+ $ blueprint = new Blueprint ($ conn , 'users ' );
1139
+ $ blueprint ->uuid ('foo ' );
1140
+ $ statements = $ blueprint ->toSql ();
1141
+
1142
+ $ this ->assertCount (1 , $ statements );
1143
+ $ this ->assertSame ('alter table `users` add `foo` char(36) not null ' , $ statements [0 ]);
1144
+ }
1145
+
1129
1146
public function testAddingUuidDefaultsColumnName ()
1130
1147
{
1131
- $ blueprint = new Blueprint ($ this ->getConnection (), 'users ' );
1148
+ $ conn = $ this ->getConnection ();
1149
+ $ conn ->shouldReceive ('getServerVersion ' )->andReturn ('10.7.0 ' );
1150
+
1151
+ $ blueprint = new Blueprint ($ conn , 'users ' );
1132
1152
$ blueprint ->uuid ();
1133
1153
$ statements = $ blueprint ->toSql ();
1134
1154
@@ -1138,7 +1158,10 @@ public function testAddingUuidDefaultsColumnName()
1138
1158
1139
1159
public function testAddingForeignUuid ()
1140
1160
{
1141
- $ blueprint = new Blueprint ($ this ->getConnection (), 'users ' );
1161
+ $ conn = $ this ->getConnection ();
1162
+ $ conn ->shouldReceive ('getServerVersion ' )->andReturn ('10.7.0 ' );
1163
+
1164
+ $ blueprint = new Blueprint ($ conn , 'users ' );
1142
1165
$ foreignUuid = $ blueprint ->foreignUuid ('foo ' );
1143
1166
$ blueprint ->foreignUuid ('company_id ' )->constrained ();
1144
1167
$ blueprint ->foreignUuid ('laravel_idea_id ' )->constrained ();
0 commit comments