3
3
namespace Maize \Markable \Tests ;
4
4
5
5
use Illuminate \Database \Eloquent \Factories \Factory ;
6
+ use Illuminate \Database \Schema \Blueprint ;
7
+ use Illuminate \Support \Facades \Schema ;
6
8
use Maize \Markable \MarkableServiceProvider ;
7
9
use Maize \Markable \Tests \Models \User ;
8
10
use Orchestra \Testbench \TestCase as Orchestra ;
@@ -27,40 +29,40 @@ protected function getPackageProviders($app)
27
29
28
30
public function getEnvironmentSetUp ($ app )
29
31
{
30
- $ app ['config ' ]->set ('database.default ' , 'sqlite ' );
31
- $ app ['config ' ]->set ('database.connections.sqlite ' , [
32
- 'driver ' => 'sqlite ' ,
33
- 'database ' => ':memory: ' ,
34
- 'prefix ' => '' ,
35
- ]);
36
-
37
- $ app ['config ' ]->set ('markable.user_model ' , User::class);
38
- $ app ['config ' ]->set ('markable.allowed_values.reaction ' , [
32
+ config ()->set ('database.default ' , 'testing ' );
33
+ config ()->set ('markable.user_model ' , User::class);
34
+ config ()->set ('markable.allowed_values.reaction ' , [
39
35
'reaction_1 ' ,
40
36
'reaction_2 ' ,
41
37
'reaction_3 ' ,
42
38
'reaction_4 ' ,
43
39
]);
44
40
45
- include_once __DIR__ .'/../database/migrations/create_users_table .php.stub ' ;
46
- ( new \ CreateUsersTable ()) ->up ();
41
+ $ migration = include __DIR__ .'/../database/migrations/create_likes_table .php.stub ' ;
42
+ $ migration ->up ();
47
43
48
- include_once __DIR__ .'/../database/migrations/create_articles_table .php.stub ' ;
49
- ( new \ CreateArticlesTable ()) ->up ();
44
+ $ migration = include __DIR__ .'/../database/migrations/create_favorites_table .php.stub ' ;
45
+ $ migration ->up ();
50
46
51
- include_once __DIR__ .'/../database/migrations/create_posts_table .php.stub ' ;
52
- ( new \ CreatePostsTable ()) ->up ();
47
+ $ migration = include __DIR__ .'/../database/migrations/create_bookmarks_table .php.stub ' ;
48
+ $ migration ->up ();
53
49
54
- include_once __DIR__ .'/../database/migrations/create_likes_table .php.stub ' ;
55
- ( new \ CreateLikesTable ()) ->up ();
50
+ $ migration = include __DIR__ .'/../database/migrations/create_reactions_table .php.stub ' ;
51
+ $ migration ->up ();
56
52
57
- include_once __DIR__ .'/../database/migrations/create_favorites_table.php.stub ' ;
58
- (new \CreateFavoritesTable ())->up ();
53
+ Schema::create ('users ' , function (Blueprint $ table ) {
54
+ $ table ->id ();
55
+ $ table ->timestamps ();
56
+ });
59
57
60
- include_once __DIR__ .'/../database/migrations/create_bookmarks_table.php.stub ' ;
61
- (new \CreateBookmarksTable ())->up ();
58
+ Schema::create ('posts ' , function (Blueprint $ table ) {
59
+ $ table ->id ();
60
+ $ table ->timestamps ();
61
+ });
62
62
63
- include_once __DIR__ .'/../database/migrations/create_reactions_table.php.stub ' ;
64
- (new \CreateReactionsTable ())->up ();
63
+ Schema::create ('articles ' , function (Blueprint $ table ) {
64
+ $ table ->id ();
65
+ $ table ->timestamps ();
66
+ });
65
67
}
66
68
}
0 commit comments