-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenStackIDBaseTestCase.php
More file actions
72 lines (70 loc) · 3.23 KB
/
Copy pathOpenStackIDBaseTestCase.php
File metadata and controls
72 lines (70 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php namespace Tests;
/**
* Copyright 2015 Openstack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
/**
* Class OpenStackIDBaseTest
*/
abstract class OpenStackIDBaseTestCase extends BrowserKitTestCase {
protected function prepareForTests():void
{
if (Schema::hasTable('banned_ips'))
DB::table('banned_ips')->delete();
if (Schema::hasTable('white_listed_ips'))
DB::table('white_listed_ips')->delete();
if (Schema::hasTable('user_exceptions_trail'))
DB::table('user_exceptions_trail')->delete();
if (Schema::hasTable('server_configuration'))
DB::table('server_configuration')->delete();
if (Schema::hasTable('server_extensions'))
DB::table('server_extensions')->delete();
if (Schema::hasTable('oauth2_client_api_scope'))
DB::table('oauth2_client_api_scope')->delete();
if (Schema::hasTable('oauth2_client_authorized_uri'))
DB::table('oauth2_client_authorized_uri')->delete();
if (Schema::hasTable('oauth2_access_token'))
DB::table('oauth2_access_token')->delete();
if (Schema::hasTable('oauth2_refresh_token'))
DB::table('oauth2_refresh_token')->delete();
if (Schema::hasTable('oauth2_client'))
DB::table('oauth2_client')->delete();
if (Schema::hasTable('openid_trusted_sites'))
DB::table('openid_trusted_sites')->delete();
if (Schema::hasTable('openid_associations'))
DB::table('openid_associations')->delete();
if (Schema::hasTable('user_actions'))
DB::table('user_actions')->delete();
if (Schema::hasTable('user_groups'))
DB::table('user_groups')->delete();
if (Schema::hasTable('groups'))
DB::table('groups')->delete();
if (Schema::hasTable('oauth2_otp'))
DB::table('oauth2_otp')->delete();
if (Schema::hasTable('user_password_reset_request'))
DB::table('user_password_reset_request')->delete();
if (Schema::hasTable('users'))
DB::table('users')->delete();
if (Schema::hasTable('oauth2_api_endpoint_api_scope'))
DB::table('oauth2_api_endpoint_api_scope')->delete();
if (Schema::hasTable('oauth2_api_endpoint'))
DB::table('oauth2_api_endpoint')->delete();
if (Schema::hasTable('oauth2_api_scope'))
DB::table('oauth2_api_scope')->delete();
if (Schema::hasTable('oauth2_api'))
DB::table('oauth2_api')->delete();
if (Schema::hasTable('oauth2_resource_server'))
DB::table('oauth2_resource_server')->delete();
parent::prepareForTests();
}
}