99use Illuminate \Support \Facades \Validator ;
1010use Orchestra \Testbench \TestCase ;
1111
12+ use function Orchestra \Testbench \laravel_version_compare ;
13+
1214class SushiTest extends TestCase
1315{
1416 public $ cachePath ;
@@ -56,7 +58,10 @@ function columns_with_varying_types()
5658 $ this ->assertEquals ('integer ' , $ connectionBuilder ->getColumnType ('model_with_varying_type_columns ' , 'int ' ));
5759 $ this ->assertEquals ('float ' , $ connectionBuilder ->getColumnType ('model_with_varying_type_columns ' , 'float ' ));
5860 $ this ->assertEquals ('datetime ' , $ connectionBuilder ->getColumnType ('model_with_varying_type_columns ' , 'dateTime ' ));
59- $ this ->assertEquals ('string ' , $ connectionBuilder ->getColumnType ('model_with_varying_type_columns ' , 'string ' ));
61+ $ this ->assertEquals (
62+ function_exists ('\Orchestra\Testbench\laravel_version_compare ' ) && laravel_version_compare ('11.0.0 ' , '>= ' ) ? 'varchar ' : 'string ' ,
63+ $ connectionBuilder ->getColumnType ('model_with_varying_type_columns ' , 'string ' )
64+ );
6065 $ this ->assertEquals (null , $ row ->null );
6166 }
6267
@@ -65,8 +70,14 @@ function model_with_custom_schema()
6570 {
6671 ModelWithCustomSchema::count ();
6772 $ connectionBuilder = ModelWithCustomSchema::resolveConnection ()->getSchemaBuilder ();
68- $ this ->assertEquals ('string ' , $ connectionBuilder ->getColumnType ('model_with_custom_schemas ' , 'float ' ));
69- $ this ->assertEquals ('string ' , $ connectionBuilder ->getColumnType ('model_with_custom_schemas ' , 'string ' ));
73+ $ this ->assertEquals (
74+ function_exists ('\Orchestra\Testbench\laravel_version_compare ' ) && laravel_version_compare ('11.0.0 ' , '>= ' ) ? 'varchar ' : 'string ' ,
75+ $ connectionBuilder ->getColumnType ('model_with_custom_schemas ' , 'float ' )
76+ );
77+ $ this ->assertEquals (
78+ function_exists ('\Orchestra\Testbench\laravel_version_compare ' ) && laravel_version_compare ('11.0.0 ' , '>= ' ) ? 'varchar ' : 'string ' ,
79+ $ connectionBuilder ->getColumnType ('model_with_custom_schemas ' , 'string ' )
80+ );
7081 }
7182
7283 /** @test */
@@ -187,6 +198,10 @@ public function it_runs_method_after_migration_when_defined()
187198 * */
188199 function sushi_models_can_relate_to_models_in_regular_sqlite_databases ()
189200 {
201+ if (! trait_exists ('\Orchestra\Testbench\Concerns\HandlesAnnotations ' )) {
202+ $ this ->markTestSkipped ('Requires HandlesAnnotation trait to define sqlite connection using PHPUnit annotation ' );
203+ }
204+
190205 $ this ->loadMigrationsFrom (__DIR__ . '/database/migrations ' );
191206 $ this ->artisan ('migrate ' , ['--database ' => 'testbench-sqlite ' ])->run ();
192207
0 commit comments