File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -905,4 +905,34 @@ public function testTime()
905
905
$ time = $ clock ->time ;
906
906
asrt ( ( strpos ( $ time , ': ' ) > 0 ), TRUE );
907
907
}
908
+
909
+ /**
910
+ * Can we use the 'ignoreDisplayWidth'-feature for MySQL 8
911
+ * compatibility?
912
+ *
913
+ * @return void
914
+ */
915
+ public function testWriterFeature () {
916
+ $ adapter = R::getToolBox ()->getDatabaseAdapter ();
917
+ $ writer = new \RedBeanPHP \QueryWriter \MySQL ( $ adapter );
918
+ $ writer ->useFeature ('ignoreDisplayWidth ' );
919
+ asrt ($ writer ->typeno_sqltype [MySQL::C_DATATYPE_BOOL ],' TINYINT UNSIGNED ' );
920
+ asrt ($ writer ->typeno_sqltype [MySQL::C_DATATYPE_UINT32 ],' INT UNSIGNED ' );
921
+ asrt ($ writer ->sqltype_typeno ['tinyint unsigned ' ],MySQL::C_DATATYPE_BOOL );
922
+ asrt ($ writer ->sqltype_typeno ['int unsigned ' ],MySQL::C_DATATYPE_UINT32 );
923
+ //Can we also pass invalid features without errors?
924
+ $ writer ->useFeature ('nonsense ' );
925
+ pass ();
926
+ }
927
+
928
+ /**
929
+ * Can we pass an options array to Writer Constructor?
930
+ *
931
+ * @return void
932
+ */
933
+ public function testWriterOptions () {
934
+ $ adapter = R::getToolBox ()->getDatabaseAdapter ();
935
+ $ writer = new \RedBeanPHP \QueryWriter \MySQL ( $ adapter , ['noInitcode ' =>TRUE ] );
936
+ pass ();
937
+ }
908
938
}
You can’t perform that action at this time.
0 commit comments