diff --git a/.gitignore b/.gitignore index dc4c74f0c..0fa2b1611 100755 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ composer.lock config/app_local.php config/Migrations/schema-dump-default.lock logs/*.log +logs/*.log.* tmp vendor webroot/theme/node_modules diff --git a/config/Migrations/20230505121246_Initial.php b/config/Migrations/20230505121246_Initial.php index 5718d0751..c60255246 100644 --- a/config/Migrations/20230505121246_Initial.php +++ b/config/Migrations/20230505121246_Initial.php @@ -1,4 +1,5 @@ table('roles'); + $now = date('Y-m-d H:i:s', time()); + + $roles = [ + [ + 'id' => 1, + 'name' => 'admin', + 'created' => $now, + 'modified' => $now, + 'perm_add' => 1, + 'perm_modify' => 1, + 'perm_modify_org' => 1, + 'perm_publish' => 1, + 'perm_delegate' => 1, + 'perm_sync' => 1, + 'perm_admin' => 1, + 'perm_audit' => 1, + 'perm_full' => 1, + 'perm_auth' => 1, + 'perm_site_admin' => 1, + 'perm_regexp_access' => 1, + 'perm_tagger' => 1, + 'perm_template' => 1, + 'perm_sharing_group' => 1, + 'perm_tag_editor' => 1, + 'perm_sighting' => 1, + 'perm_object_template' => 1, + 'default_role' => 0, + 'memory_limit' => '', + 'max_execution_time' => '', + 'restricted_to_site_admin' => 0, + 'perm_publish_zmq' => 1, + 'perm_publish_kafka' => 1, + 'perm_decaying' => 1, + 'enforce_rate_limit' => 0, + 'rate_limit_count' => 0, + 'perm_galaxy_editor' => 1, + 'perm_warninglist' => 0 + ], + [ + 'id' => 2, + 'name' => 'Org Admin', + 'created' => $now, + 'modified' => $now, + 'perm_add' => 1, + 'perm_modify' => 1, + 'perm_modify_org' => 1, + 'perm_publish' => 1, + 'perm_delegate' => 1, + 'perm_sync' => 0, + 'perm_admin' => 1, + 'perm_audit' => 1, + 'perm_full' => 0, + 'perm_auth' => 1, + 'perm_site_admin' => 0, + 'perm_regexp_access' => 0, + 'perm_tagger' => 1, + 'perm_template' => 1, + 'perm_sharing_group' => 1, + 'perm_tag_editor' => 1, + 'perm_sighting' => 0, + 'perm_object_template' => 0, + 'default_role' => 0, + 'memory_limit' => '', + 'max_execution_time' => '', + 'restricted_to_site_admin' => 1, + 'perm_publish_zmq' => 1, + 'perm_publish_kafka' => 1, + 'perm_decaying' => 1, + 'enforce_rate_limit' => 0, + 'rate_limit_count' => 0, + 'perm_galaxy_editor' => 1, + 'perm_warninglist' => 0 + ], + [ + 'id' => 3, + 'name' => 'User', + 'created' => $now, + 'modified' => $now, + 'perm_add' => 1, + 'perm_modify' => 1, + 'perm_modify_org' => 1, + 'perm_publish' => 0, + 'perm_delegate' => 0, + 'perm_sync' => 0, + 'perm_admin' => 0, + 'perm_audit' => 1, + 'perm_full' => 0, + 'perm_auth' => 1, + 'perm_site_admin' => 0, + 'perm_regexp_access' => 0, + 'perm_tagger' => 1, + 'perm_template' => 0, + 'perm_sharing_group' => 0, + 'perm_tag_editor' => 0, + 'perm_sighting' => 1, + 'perm_object_template' => 0, + 'default_role' => 1, + 'memory_limit' => '', + 'max_execution_time' => '', + 'restricted_to_site_admin' => 0, + 'perm_publish_zmq' => 0, + 'perm_publish_kafka' => 0, + 'perm_decaying' => 1, + 'enforce_rate_limit' => 0, + 'rate_limit_count' => 0, + 'perm_galaxy_editor' => 0, + 'perm_warninglist' => 0 + ], + [ + 'id' => 4, + 'name' => 'Publisher', + 'created' => $now, + 'modified' => $now, + 'perm_add' => 1, + 'perm_modify' => 1, + 'perm_modify_org' => 1, + 'perm_publish' => 1, + 'perm_delegate' => 1, + 'perm_sync' => 0, + 'perm_admin' => 0, + 'perm_audit' => 1, + 'perm_full' => 0, + 'perm_auth' => 1, + 'perm_site_admin' => 0, + 'perm_regexp_access' => 0, + 'perm_tagger' => 1, + 'perm_template' => 0, + 'perm_sharing_group' => 0, + 'perm_tag_editor' => 0, + 'perm_sighting' => 1, + 'perm_object_template' => 0, + 'default_role' => 0, + 'memory_limit' => '', + 'max_execution_time' => '', + 'restricted_to_site_admin' => 0, + 'perm_publish_zmq' => 1, + 'perm_publish_kafka' => 1, + 'perm_decaying' => 1, + 'enforce_rate_limit' => 0, + 'rate_limit_count' => 0, + 'perm_galaxy_editor' => 0, + 'perm_warninglist' => 0 + ], + [ + 'id' => 5, + 'name' => 'Sync user', + 'created' => $now, + 'modified' => $now, + 'perm_add' => 1, + 'perm_modify' => 1, + 'perm_modify_org' => 1, + 'perm_publish' => 1, + 'perm_delegate' => 1, + 'perm_sync' => 1, + 'perm_admin' => 0, + 'perm_audit' => 1, + 'perm_full' => 0, + 'perm_auth' => 1, + 'perm_site_admin' => 0, + 'perm_regexp_access' => 0, + 'perm_tagger' => 1, + 'perm_template' => 0, + 'perm_sharing_group' => 1, + 'perm_tag_editor' => 1, + 'perm_sighting' => 1, + 'perm_object_template' => 0, + 'default_role' => 0, + 'memory_limit' => '', + 'max_execution_time' => '', + 'restricted_to_site_admin' => 0, + 'perm_publish_zmq' => 1, + 'perm_publish_kafka' => 1, + 'perm_decaying' => 1, + 'enforce_rate_limit' => 0, + 'rate_limit_count' => 0, + 'perm_galaxy_editor' => 1, + 'perm_warninglist' => 0 + ], + [ + 'id' => 6, + 'name' => 'Read Only', + 'created' => $now, + 'modified' => $now, + 'perm_add' => 0, + 'perm_modify' => 0, + 'perm_modify_org' => 0, + 'perm_publish' => 0, + 'perm_delegate' => 0, + 'perm_sync' => 0, + 'perm_admin' => 0, + 'perm_audit' => 1, + 'perm_full' => 0, + 'perm_auth' => 1, + 'perm_site_admin' => 0, + 'perm_regexp_access' => 0, + 'perm_tagger' => 0, + 'perm_template' => 0, + 'perm_sharing_group' => 0, + 'perm_tag_editor' => 0, + 'perm_sighting' => 0, + 'perm_object_template' => 0, + 'default_role' => 0, + 'memory_limit' => '', + 'max_execution_time' => '', + 'restricted_to_site_admin' => 0, + 'perm_publish_zmq' => 0, + 'perm_publish_kafka' => 0, + 'perm_decaying' => 0, + 'enforce_rate_limit' => 0, + 'rate_limit_count' => 0, + 'perm_galaxy_editor' => 0, + 'perm_warninglist' => 0 + ] + ]; + + $rolesTable->insert($roles)->saveData(); + } + + public function down() + { + $this->execute('DELETE FROM roles where id IN (1,2,3,4,5,6)'); + } +} diff --git a/tests/Fixture/AuthKeysFixture.php b/tests/Fixture/AuthKeysFixture.php index 0009e6afa..a08e4a856 100644 --- a/tests/Fixture/AuthKeysFixture.php +++ b/tests/Fixture/AuthKeysFixture.php @@ -11,16 +11,16 @@ class AuthKeysFixture extends TestFixture { public $connection = 'test'; - public const ADMIN_API_ID = 1; + public const ADMIN_API_ID = 1000; public const ADMIN_API_KEY = 'sL9hrjIyY405RyGQHLx5DoCAM92BNmmGa8P4ck1E'; - public const SYNC_API_ID = 2; + public const SYNC_API_ID = 2000; public const SYNC_API_KEY = '6b387ced110858dcbcda36edb044dc18f91a0894'; - public const ORG_ADMIN_API_ID = 3; + public const ORG_ADMIN_API_ID = 3000; public const ORG_ADMIN_API_KEY = '1c4685d281d478dbcebd494158024bc3539004d0'; - public const REGULAR_USER_API_ID = 4; + public const REGULAR_USER_API_ID = 4000; public const REGULAR_USER_API_KEY = '12dea96fec20593566ab75692c9949596833adc9'; public function init(): void diff --git a/tests/Fixture/OrganisationsFixture.php b/tests/Fixture/OrganisationsFixture.php index eeb82c73b..f90ea1076 100644 --- a/tests/Fixture/OrganisationsFixture.php +++ b/tests/Fixture/OrganisationsFixture.php @@ -10,10 +10,10 @@ class OrganisationsFixture extends TestFixture { public $connection = 'test'; - public const ORGANISATION_A_ID = 1; + public const ORGANISATION_A_ID = 1000; public const ORGANISATION_A_UUID = 'dce5017e-b6a5-4d0d-a0d7-81e9af56c82c'; - public const ORGANISATION_B_ID = 2; + public const ORGANISATION_B_ID = 2000; public const ORGANISATION_B_UUID = '36d22d9a-851e-4838-a655-9999c1d19497'; public function init(): void diff --git a/tests/Fixture/RolesFixture.php b/tests/Fixture/RolesFixture.php deleted file mode 100644 index 1230e8f9b..000000000 --- a/tests/Fixture/RolesFixture.php +++ /dev/null @@ -1,62 +0,0 @@ -records = [ - [ - 'id' => self::ROLE_ADMIN_ID, - 'uuid' => $faker->uuid(), - 'name' => 'admin', - 'is_default' => false, - 'perm_admin' => true, - 'perm_sync' => false, - 'perm_org_admin' => false - ], - [ - 'id' => self::ROLE_SYNC_ID, - 'uuid' => $faker->uuid(), - 'name' => 'sync', - 'is_default' => false, - 'perm_admin' => false, - 'perm_sync' => true, - 'perm_org_admin' => false - ], - [ - 'id' => self::ROLE_ORG_ADMIN_ID, - 'uuid' => $faker->uuid(), - 'name' => 'org_admin', - 'is_default' => false, - 'perm_admin' => false, - 'perm_sync' => false, - 'perm_org_admin' => true - ], - [ - 'id' => self::ROLE_REGULAR_USER_ID, - 'uuid' => $faker->uuid(), - 'name' => 'user', - 'is_default' => true, - 'perm_admin' => false, - 'perm_sync' => false, - 'perm_org_admin' => false - ] - ]; - parent::init(); - } -} diff --git a/tests/Fixture/UsersFixture.php b/tests/Fixture/UsersFixture.php index bd398495e..7c7230235 100644 --- a/tests/Fixture/UsersFixture.php +++ b/tests/Fixture/UsersFixture.php @@ -12,25 +12,32 @@ class UsersFixture extends TestFixture public $connection = 'test'; // Admin user - public const USER_ADMIN_ID = 1; + public const USER_ADMIN_ID = 1000; public const USER_ADMIN_EMAIL = 'admin@test.test'; public const USER_ADMIN_PASSWORD = 'AdminPassword'; // Sync user - public const USER_SYNC_ID = 2; + public const USER_SYNC_ID = 2000; public const USER_SYNC_EMAIL = 'sync@test.test'; public const USER_SYNC_PASSWORD = 'SyncPassword'; // Org Admin user - public const USER_ORG_ADMIN_ID = 3; + public const USER_ORG_ADMIN_ID = 3000; public const USER_ORG_ADMIN_EMAIL = 'org_admin@test.test'; public const USER_ORG_ADMIN_PASSWORD = 'OrgAdminPassword'; // Regular User user - public const USER_REGULAR_USER_ID = 4; + public const USER_REGULAR_USER_ID = 4000; public const USER_REGULAR_USER_EMAIL = 'user@test.test'; public const USER_REGULAR_USER_PASSWORD = 'UserPassword'; + // Default Roles IDs + public const ROLE_ADMIN_ID = 1; + public const ROLE_ORG_ADMIN_ID = 2; + public const ROLE_REGULAR_USER_ID = 3; + public const ROLE_PUBLISHER_ID = 4; + public const ROLE_SYNC_ID = 5; + public const ROLE_READ_ONLY_ID = 6; public function init(): void { @@ -43,7 +50,7 @@ class UsersFixture extends TestFixture 'uuid' => $faker->uuid(), 'email' => self::USER_ADMIN_EMAIL, 'password' => $hasher->hash(self::USER_ADMIN_PASSWORD), - 'role_id' => RolesFixture::ROLE_ADMIN_ID, + 'role_id' => self::ROLE_ADMIN_ID, 'disabled' => 0, 'org_id' => OrganisationsFixture::ORGANISATION_A_ID, 'date_created' => $faker->dateTime()->getTimestamp(), @@ -54,7 +61,7 @@ class UsersFixture extends TestFixture 'uuid' => $faker->uuid(), 'email' => self::USER_SYNC_EMAIL, 'password' => $hasher->hash(self::USER_SYNC_PASSWORD), - 'role_id' => RolesFixture::ROLE_SYNC_ID, + 'role_id' => self::ROLE_SYNC_ID, 'disabled' => 0, 'org_id' => OrganisationsFixture::ORGANISATION_A_ID, 'date_created' => $faker->dateTime()->getTimestamp(), @@ -65,7 +72,7 @@ class UsersFixture extends TestFixture 'uuid' => $faker->uuid(), 'email' => self::USER_ORG_ADMIN_EMAIL, 'password' => $hasher->hash(self::USER_ORG_ADMIN_PASSWORD), - 'role_id' => RolesFixture::ROLE_ORG_ADMIN_ID, + 'role_id' => self::ROLE_ORG_ADMIN_ID, 'disabled' => 0, 'org_id' => OrganisationsFixture::ORGANISATION_A_ID, 'date_created' => $faker->dateTime()->getTimestamp(), @@ -76,7 +83,7 @@ class UsersFixture extends TestFixture 'uuid' => $faker->uuid(), 'email' => self::USER_REGULAR_USER_EMAIL, 'password' => $hasher->hash(self::USER_REGULAR_USER_PASSWORD), - 'role_id' => RolesFixture::ROLE_REGULAR_USER_ID, + 'role_id' => self::ROLE_REGULAR_USER_ID, 'disabled' => 0, 'org_id' => OrganisationsFixture::ORGANISATION_A_ID, 'date_created' => $faker->dateTime()->getTimestamp(), diff --git a/tests/TestCase/Api/Allowedlists/IndexAllowedlistsApiTest.php b/tests/TestCase/Api/Allowedlists/IndexAllowedlistsApiTest.php new file mode 100644 index 000000000..53b4c0402 --- /dev/null +++ b/tests/TestCase/Api/Allowedlists/IndexAllowedlistsApiTest.php @@ -0,0 +1,36 @@ +skipOpenApiValidations(); + + $this->setAuthToken(AuthKeysFixture::ADMIN_API_KEY); + + $this->get(self::ENDPOINT); + + $this->assertResponseOk(); + $this->assertResponseContains(sprintf('"event_uuid": "%s"', EventBlocklistsFixture::EVENT_BLOCK_LIST_1_EVENT_UUID)); + } +} diff --git a/tests/TestCase/Api/EventBlockLists/AddEventBlocklistApiTest.php b/tests/TestCase/Api/EventBlockLists/AddEventBlocklistApiTest.php index 7c931d6c6..50d0f34b1 100644 --- a/tests/TestCase/Api/EventBlockLists/AddEventBlocklistApiTest.php +++ b/tests/TestCase/Api/EventBlockLists/AddEventBlocklistApiTest.php @@ -16,7 +16,6 @@ class AddEventBlocklistApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys', 'app.EventBlocklists' diff --git a/tests/TestCase/Api/EventBlockLists/DeleteEventBlocklistApiTest.php b/tests/TestCase/Api/EventBlockLists/DeleteEventBlocklistApiTest.php index 022ae2fd9..c5e205596 100644 --- a/tests/TestCase/Api/EventBlockLists/DeleteEventBlocklistApiTest.php +++ b/tests/TestCase/Api/EventBlockLists/DeleteEventBlocklistApiTest.php @@ -17,7 +17,6 @@ class DeleteEventBlocklistApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys', 'app.EventBlocklists' diff --git a/tests/TestCase/Api/EventBlockLists/EditEventBlocklistApiTest.php b/tests/TestCase/Api/EventBlockLists/EditEventBlocklistApiTest.php index f2d3a748b..ec8f8350b 100644 --- a/tests/TestCase/Api/EventBlockLists/EditEventBlocklistApiTest.php +++ b/tests/TestCase/Api/EventBlockLists/EditEventBlocklistApiTest.php @@ -17,7 +17,6 @@ class EditEventBlocklistApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys', 'app.EventBlocklists' diff --git a/tests/TestCase/Api/EventBlockLists/IndexEventBlocklistsApiTest.php b/tests/TestCase/Api/EventBlockLists/IndexEventBlocklistsApiTest.php index 38df84828..40adf9435 100644 --- a/tests/TestCase/Api/EventBlockLists/IndexEventBlocklistsApiTest.php +++ b/tests/TestCase/Api/EventBlockLists/IndexEventBlocklistsApiTest.php @@ -17,7 +17,6 @@ class IndexEventBlocklistsApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys', 'app.EventBlocklists' diff --git a/tests/TestCase/Api/EventBlockLists/MassDeleteBlocklistsApiTest.php b/tests/TestCase/Api/EventBlockLists/MassDeleteBlocklistsApiTest.php index 07d1f8022..3f35b7104 100644 --- a/tests/TestCase/Api/EventBlockLists/MassDeleteBlocklistsApiTest.php +++ b/tests/TestCase/Api/EventBlockLists/MassDeleteBlocklistsApiTest.php @@ -17,7 +17,6 @@ class MassDeleteBlocklistsApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys', 'app.EventBlocklists' diff --git a/tests/TestCase/Api/Users/AddUserApiTest.php b/tests/TestCase/Api/Users/AddUserApiTest.php index b31c1523b..11ad9a585 100644 --- a/tests/TestCase/Api/Users/AddUserApiTest.php +++ b/tests/TestCase/Api/Users/AddUserApiTest.php @@ -19,7 +19,6 @@ class AddUserApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys' ]; @@ -33,7 +32,7 @@ class AddUserApiTest extends TestCase [ 'individual_id' => UsersFixture::USER_REGULAR_USER_ID, 'organisation_id' => OrganisationsFixture::ORGANISATION_A_ID, - 'role_id' => RolesFixture::ROLE_REGULAR_USER_ID, + 'role_id' => UsersFixture::ROLE_REGULAR_USER_ID, 'disabled' => false, 'username' => 'test', 'password' => 'Password123456!', @@ -54,7 +53,7 @@ class AddUserApiTest extends TestCase [ 'individual_id' => UsersFixture::USER_REGULAR_USER_ID, 'organisation_id' => OrganisationsFixture::ORGANISATION_A_ID, - 'role_id' => RolesFixture::ROLE_REGULAR_USER_ID, + 'role_id' => UsersFixture::ROLE_REGULAR_USER_ID, 'disabled' => false, 'username' => 'test', 'password' => 'Password123456!' diff --git a/tests/TestCase/Api/Users/ChangePasswordApiTest.php b/tests/TestCase/Api/Users/ChangePasswordApiTest.php index 4e622f211..024ae3f22 100644 --- a/tests/TestCase/Api/Users/ChangePasswordApiTest.php +++ b/tests/TestCase/Api/Users/ChangePasswordApiTest.php @@ -28,7 +28,6 @@ class ChangePasswordApiTest extends TestCase protected $fixtures = [ 'app.Organisations', 'app.Individuals', - 'app.Roles', 'app.Users', 'app.AuthKeys' ]; @@ -64,13 +63,13 @@ class ChangePasswordApiTest extends TestCase $request = new ServerRequest([ 'url' => 'users/login', 'post' => [ - 'username' => UsersFixture::USER_REGULAR_USER_USERNAME, + 'username' => UsersFixture::USER_REGULAR_USER_EMAIL, 'password' => $newPassword ], ]); $result = $this->auth->authenticate($request, new Response()); $this->assertEquals(UsersFixture::USER_REGULAR_USER_ID, $result['id']); - $this->assertEquals(UsersFixture::USER_REGULAR_USER_USERNAME, $result['username']); + $this->assertEquals(UsersFixture::USER_REGULAR_USER_EMAIL, $result['username']); } } diff --git a/tests/TestCase/Api/Users/DeleteUserApiTest.php b/tests/TestCase/Api/Users/DeleteUserApiTest.php index 7ad495ec7..30988f2e0 100644 --- a/tests/TestCase/Api/Users/DeleteUserApiTest.php +++ b/tests/TestCase/Api/Users/DeleteUserApiTest.php @@ -17,7 +17,6 @@ class DeleteUserApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys' ]; diff --git a/tests/TestCase/Api/Users/EditUserApiTest.php b/tests/TestCase/Api/Users/EditUserApiTest.php index 3a3db84e1..804bdabf7 100644 --- a/tests/TestCase/Api/Users/EditUserApiTest.php +++ b/tests/TestCase/Api/Users/EditUserApiTest.php @@ -18,7 +18,6 @@ class EditUserApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys' ]; @@ -33,14 +32,14 @@ class EditUserApiTest extends TestCase $url, [ 'id' => UsersFixture::USER_REGULAR_USER_ID, - 'role_id' => RolesFixture::ROLE_ORG_ADMIN_ID, + 'role_id' => UsersFixture::ROLE_ORG_ADMIN_ID, ] ); $this->assertResponseOk(); $this->assertDbRecordExists('Users', [ 'id' => UsersFixture::USER_REGULAR_USER_ID, - 'role_id' => RolesFixture::ROLE_ORG_ADMIN_ID + 'role_id' => UsersFixture::ROLE_ORG_ADMIN_ID ]); } @@ -51,14 +50,14 @@ class EditUserApiTest extends TestCase $this->put( self::ENDPOINT, [ - 'role_id' => RolesFixture::ROLE_ADMIN_ID, + 'role_id' => UsersFixture::ROLE_ADMIN_ID, ] ); $this->assertResponseOk(); $this->assertDbRecordNotExists('Users', [ 'id' => UsersFixture::USER_REGULAR_USER_ID, - 'role_id' => RolesFixture::ROLE_ADMIN_ID + 'role_id' => UsersFixture::ROLE_ADMIN_ID ]); } } diff --git a/tests/TestCase/Api/Users/IndexUsersApiTest.php b/tests/TestCase/Api/Users/IndexUsersApiTest.php index f1328a2d1..2430fe004 100644 --- a/tests/TestCase/Api/Users/IndexUsersApiTest.php +++ b/tests/TestCase/Api/Users/IndexUsersApiTest.php @@ -17,7 +17,6 @@ class IndexUsersApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys' ]; diff --git a/tests/TestCase/Api/Users/ViewUserApiTest.php b/tests/TestCase/Api/Users/ViewUserApiTest.php index febcffebb..06bcab898 100644 --- a/tests/TestCase/Api/Users/ViewUserApiTest.php +++ b/tests/TestCase/Api/Users/ViewUserApiTest.php @@ -17,7 +17,6 @@ class ViewUserApiTest extends TestCase protected $fixtures = [ 'app.Organisations', - 'app.Roles', 'app.Users', 'app.AuthKeys' ]; diff --git a/tests/TestCase/Controller/Users/UsersControllerTest.php b/tests/TestCase/Controller/Users/UsersControllerTest.php index 540d70c51..5868a32eb 100644 --- a/tests/TestCase/Controller/Users/UsersControllerTest.php +++ b/tests/TestCase/Controller/Users/UsersControllerTest.php @@ -13,7 +13,6 @@ class UsersControllerTest extends TestCase use IntegrationTestTrait; protected $fixtures = [ - 'app.Roles', 'app.Users' ]; public function testLogin(): void diff --git a/tests/bootstrap.php b/tests/bootstrap.php index b911d5fd5..42118090d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -57,11 +57,14 @@ session_id('cli'); if (!$_ENV['SKIP_DB_MIGRATIONS']) { echo "[ * ] Running DB migrations, it may take some time ...\n"; $migrator = new Migrator(); - $migrator->runMany([ - ['connection' => 'test'], - ['plugin' => 'Tags', 'connection' => 'test'], - ['plugin' => 'ADmad/SocialAuth', 'connection' => 'test'] - ]); + $migrator->runMany( + [ + ['connection' => 'test'], + ['plugin' => 'Tags', 'connection' => 'test'], + ['plugin' => 'ADmad/SocialAuth', 'connection' => 'test'] + ], + false // Do not truncate tables + ); } else { echo "[ * ] Skipping DB migrations ...\n"; }