2
2
3
3
namespace Junges \ACL \Test ;
4
4
5
- use Illuminate \Support \Facades \DB ;
6
5
use Junges \ACL \ACLServiceProvider ;
7
6
use Junges \ACL \ACLAuthServiceProvider ;
8
7
use Illuminate \Database \Schema \Blueprint ;
@@ -104,15 +103,11 @@ public function getPackageProviders($app)
104
103
*/
105
104
public function getEnvironmentSetUp ($ app )
106
105
{
107
- $ app ['config ' ]->set ('database.default ' , 'pgsql ' );
108
- $ app ['config ' ]->set ('database.connections.pgsql ' , [
109
- 'driver ' => 'pgsql ' ,
110
- 'username ' => 'postgres ' ,
111
- 'port ' => '5432 ' ,
112
- 'host ' => '127.0.0.1 ' ,
113
- 'password ' => env ('DB_PASSWORD ' , '' ),
114
- 'database ' => 'laravel_acl_tests ' ,
115
- 'prefix ' => '' ,
106
+ $ app ['config ' ]->set ('database.default ' , 'sqlite ' );
107
+ $ app ['config ' ]->set ('database.connections.sqlite ' , [
108
+ 'driver ' => 'sqlite ' ,
109
+ 'database ' => ':memory: ' ,
110
+ 'prefix ' => '' ,
116
111
]);
117
112
$ app ['config ' ]->set ('views.path ' , [__DIR__ .'/resources/views ' ]);
118
113
@@ -126,13 +121,6 @@ public function getEnvironmentSetUp($app)
126
121
*/
127
122
public function configureDatabase ($ app )
128
123
{
129
- DB ::statement ('DROP TABLE IF EXISTS test_permissions CASCADE; ' );
130
- DB ::statement ('DROP TABLE IF EXISTS test_users CASCADE; ' );
131
- DB ::statement ('DROP TABLE IF EXISTS test_groups CASCADE; ' );
132
- DB ::statement ('DROP TABLE IF EXISTS test_user_has_permissions CASCADE; ' );
133
- DB ::statement ('DROP TABLE IF EXISTS test_user_has_groups CASCADE; ' );
134
- DB ::statement ('DROP TABLE IF EXISTS test_group_has_permissions CASCADE; ' );
135
-
136
124
/*
137
125
* Set up the tables for testing proposes
138
126
*/
@@ -169,11 +157,6 @@ public function configureDatabase($app)
169
157
/*
170
158
* Create the tables on the database
171
159
*/
172
- (new \CreatePermissionsTable ())->down ();
173
- (new \CreateGroupsTable ())->down ();
174
- (new \CreateGroupHasPermissionsTable ())->down ();
175
- (new \CreateUserHasPermissionsTable ())->down ();
176
- (new \CreateUserHasGroupsTable ())->down ();
177
160
(new \CreatePermissionsTable ())->up ();
178
161
(new \CreateGroupsTable ())->up ();
179
162
(new \CreateGroupHasPermissionsTable ())->up ();
0 commit comments