File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -33,4 +33,26 @@ public function testEloquentDataMethodForBigInteger()
3333 $ actual = $ field ->getEloquentDataMethod ();
3434 $ this ->assertEquals ($ expected , $ actual );
3535 }
36+
37+ public function testAutoIncrementFalseIsHonouredWithUnderscores ()
38+ {
39+ $ sourceString = 'name:id;data-type:varchar;is_primary:true;is_auto_increment:false;is_nullable:false;data-type-params:5000 ' ;
40+
41+ $ fields = FieldTransformer::fromString ($ sourceString , 'generic ' , []);
42+ $ this ->assertTrue (is_array ($ fields ) && 1 == count ($ fields ));
43+ $ field = $ fields [0 ];
44+
45+ $ this ->assertFalse ($ field ->isAutoIncrement );
46+ }
47+
48+ public function testAutoIncrementFalseIsHonouredWithHyphens ()
49+ {
50+ $ sourceString = 'name:id;data-type:varchar;is-primary:true;is-auto-increment:false;is-nullable:false;data-type-params:5000 ' ;
51+
52+ $ fields = FieldTransformer::fromString ($ sourceString , 'generic ' , []);
53+ $ this ->assertTrue (is_array ($ fields ) && 1 == count ($ fields ));
54+ $ field = $ fields [0 ];
55+
56+ $ this ->assertFalse ($ field ->isAutoIncrement );
57+ }
3658}
You can’t perform that action at this time.
0 commit comments