File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,23 @@ public function testView(): void
81
81
Schema::drop ('view_1 ' );
82
82
}
83
83
84
+ public function testWhenTableHasColumn (): void
85
+ {
86
+ Schema::create ('foo ' , static function (Blueprint $ table ) {
87
+ $ table ->comment ('This is a comment ' );
88
+ $ table ->increments ('id ' );
89
+ });
90
+ Schema::whenTableDoesntHaveColumn ('foo ' , 'name ' , static function (Blueprint $ table ) {
91
+ $ table ->string ('name ' );
92
+ });
93
+ $ this ->assertTrue (Schema::hasColumn ('foo ' , 'name ' ));
94
+ Schema::whenTableHasColumn ('foo ' , 'name ' , static function (Blueprint $ table ) {
95
+ $ table ->dropColumn ('name ' );
96
+ });
97
+ $ this ->assertFalse (Schema::hasColumn ('foo ' , 'name ' ));
98
+ Schema::drop ('foo ' );
99
+ }
100
+
84
101
public function testColumn (): void
85
102
{
86
103
Schema::create ('column_1 ' , static function (Blueprint $ table ) {
You can’t perform that action at this time.
0 commit comments