1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:04:02 +00:00
Commit graph

55 commits

Author SHA1 Message Date
8960a83047
[4.x] Laravel 12 support (#1321)
* Add Laravel 12 support, drop Laravel 11 support

* Fix RLS tree generation (specify schema name in generateTrees())

* ci fixes, use stable virtualcolumn version

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
2025-02-25 16:26:18 +01:00
lukinovec
fffaf7c58c
Test ecnrypted casts (#1284) 2025-02-14 08:48:16 +01:00
9ee1d63dce sqlite: use WAL journal mode by default 2024-10-11 21:31:54 +02:00
0fc105487b Tenant DB manager database() -> connection() 2024-09-12 18:34:45 +02:00
Samuel Štancl
7317d2638a
Postgres RLS + permission controlled database managers (#33)
This PR adds Postgres RLS (trait manager + table manager approach) and permission controlled managers for PostgreSQL.

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2024-04-24 22:32:49 +02:00
lukinovec
be031ad45a Clear bootstrappers in TestCase 2024-04-04 18:04:45 +02:00
Samuel Štancl
fd6070ff1b
Update SQL syntax in tests for MySQL 8 (#35)
* Bump MySQL to v8 in CI

* Remove `identified by` from queries executed in tests
2024-03-12 16:34:20 +01:00
lukinovec
cf3d06c8ec
Add permission-controlled SqlSrv database manager (#17)
* Add permission controleld MSSQL DB manager

* Fix code style (php-cs-fixer)

* Fix manager

* Don't change databases when creating MSSQL user

* Test permission controlled MSSQL DB manager

* Fix code style (php-cs-fixer)

* Delete redundant config resetting in tests

* Grant user permissions insteead of making the user the database owner

* Test that user gets created in the tenant DB

* Test that the correct permissions are granted to the DB users

* Fix code style (php-cs-fixer)

* Update config comment

* Fix typo

* Add perm controlled sqlsr db manager to test dataset

* Close all connections before deleting MSSQL DBs

* Fix code style (php-cs-fixer)

* Add explanation to deleteDatabase()

* Update tests/DatabaseUsersTest.php

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>

* Fix code style (php-cs-fixer)

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2024-01-08 04:07:43 +01:00
Abrar Ahmad
1d0ca27bc8
Central routes without Route::domain(), configurable tenant/central routes by default for domain/subdomain identification, allow accessing central routes in early identification for path & request data middleware (#3)
* Update url binding bootstrapper test

* Fix parent::temporarySignedRoute() call

* Add universal route tests for all identification types

* Improve determineContextFromRequest()

* Add setting `TenancyUrlGenerator::$prefixRouteNames` to true in TSP stub

* Delete seemingly redundant test (making one route universal won't make all routes universal in any case)

* Use collection syntax in ReregisterUniversalRoutes

* Improve comments

* Add domain identification MW annotation

* Update condition in GloballyUsable

* Set `tenancy.bootstrappers` instead of adding the bootstrappers using `tenancy.bootstrappers.x`, move test

* Revert GloballyUsable condition change

* Delete assigning bootstrappers to tenancy.bootstrappers.x

* Exclude cache prefixing bootstrapper from the initial configuration

* Fix test

* Unset bypass parameter

* Set static kernel identification-related properties in TestCase

* Update bootstrapper name in annotation

* Move unset() into a condition

* Update TenancyUrlGenerator condition

* Set static properties without instantiating Tenancy

* Fix unsetting bypass parameter

* formatting changes

* add a comment

* improve docblock

* add docblock to TenancyUrlGenerator [ci skip]

* docblock changes [ci skip]

* Update TenancyUrlGenerator (rename variable, allow bypassing prefixing temporarySignedRoute name)

* Improve determineContextFromRequest

* Only return the new url generator instance when extending 'url' in UrlBindingBootstrapper

* Check route's MW groups for the path ID MW

* Remove extra imports from config

* Rename MiddlewareContext to Context, add condition for skipping ID MW

* Set only the needed bootstrappers in TestCase

* Fix code style (php-cs-fixer)

* Remove condition

* Use correct return type

* Fix PHPStan issue

* Update comment

* Check for tenant parameter instead of prefix

* Update shouldBeSkipped condition for universal routes

* Don't remove the 'universal' MW group after route re-registration, update test

* Fix code style (php-cs-fixer)

* Fix typo

* Add test for mixing placement of access prevention and identification MW

* Add test for mixing placement of access prevention and identification MW

* Update docblock

* Add setting the session and key resolvers in UrlBindingBootstrapper (required with LW file uploads)

* Update stub

* Update variable name in route reregistering action

* Add trailing comma

* Fix code style (php-cs-fixer)

* Require routes using path identification to be flagged as tenant in order to be recognized as tenant routes

* Add tenant flag while re-registering routes

* Update determineContextFromRequest condition (wip)

* Fix code style (php-cs-fixer)

* Update the middleware context logic so that universal routes have to be flagged as tenant instead of just having ID MW

* Update path identification condition

* Fix re-registering the LW localized route (add 'tenant' MW)

* Update docblock

* Simplify LW route re-registration

* Add comment

* Update comment

* Simplify determineContextFromRequest, add comment

* Improve stub

* Add skipRoute method + test

* Fix typo

* Update assets/TenancyServiceProvider.stub.php

* Update src/Concerns/DealsWithEarlyIdentification.php

* Fix typo

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>

* Improve comment

* Update test structure

* Restructure Fortify test

* code style

* Fix typo

* Update ReregisterUniversalRoutes annotation

* Only prefix route  name if it wasn't already prefixed

* Add todo@docs

* Delete `Tenancy::$kernelAccessPreventionSkipped` and related logic

* Delete test tenant cleanup

* Test MW group unpacking, restructure and improve test

* Test that tenancy isn't initialized after visiting a central route with the tenant parameter

* Delete "in both central and tenant contexts" from test names

* Test that re-registering works with controllers too

* Set misc route properties during re-registering

* Determine context instead of guessing, update universal route tests

* Use randomly generated tenant ID instead of hardcoding `acme`

* Remove setting route validators

* Rename and update determine context method, add comments

* Update ForgetTenantParameter annotation

* Add comment

* Delete comment, delete variable assignment

* Update early domain identification test

* Improve domain identification tests (test defaulting accurately)

* Improve readability

* Simplify domain early ID test

* Use randomly generated tenant instead of 'acme'

* Simplify request data ID test, use random tenant instead of 'acme'

* Simplify defaulting domain identification test

* Use RouteFacade alias for the Route facade, improve test code

* Add defaulting to the request data and path ID tests

* Merge path identification tenant parameter removal tests, clean up

* Correct wording

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>

* Delete debugging things from UniversalRouteTest

* Update annotation

* Add `// Creates a matrix`

* Improve comment wording

* Add MiddlewareUsableWithUniversalRoutes, refactor code accordingly

* Fix code style (php-cs-fixer)

* Delete debugging leftovers

* Delete unused import

* Update universal route GloballyUsable condition

* Don't implement the universal route interface in access prevention MW

* Check if request host is in the central domains in domain ID MW

* Test universal routes with domain identification without access prevent MW

* Test that universal routes work only with identification MW implementing the universal route interface

* Fix code style (php-cs-fixer)

* Rename GloballyUsable to UsableWithEarlyIdentification

* Fix annotation

* Update requestHasTenant annotations

* Update comment

* Add `with()` comments

* Add with() comments where missing

* Rename interface, update/add comments

* Rename exception, update its default message

* Fix code style (php-cs-fixer)

* Fix interface name

* Delete redundant code from subdomain ID MW

* Change domainOrSubdomain ID MW so that instead of passing the identification to other MWs, it happens in the domainOrSubdomain MW

* Test domainOrSubdomain identification with universal routes

* Fix code style (php-cs-fixer)

* Rename universal routes interface

* Fix code style (php-cs-fixer)

* Try explaining forgetting the tenant parameter better

* update interface name reference

* uncouple example from query parameters

* Update ForgetTenantParameter.php

* Update ForgetTenantParameter annotation

* Check both routeHasMiddleware and routeHasIdentificationMiddleware in the route MW detection test

* Hardcode tenant subdomain

* Delete redundant event listening code

* Delete unused imports

* Delete misuse of `tenancy()->getMiddlewareContext()` from conditions

* Delete unused variable

* Update comment

* Correct request data identification test (defaulting)

* Fix defaulting in path id test

* Move default route context configuration in domian id test

* Rename and update the tenant parameter test

* Delete extra tenant parameter test

* Use `tenant-domain.test` instead of `127.0.0.2`

* Add `default_to_universal_routes` config key

* Deal with defaulting to universal routes in the reregistering action

* Update logic to make defaulting to universal routes possible

* Test defaulting to universal routes

* Fix code style (php-cs-fixer)

* Delete extra tests

* Delete "without access prevention" from datasets

* Add defaulting to universal routes to datasets

* Override universal flag by central/tenant flag

* Add universal flag overriding test

* Update "a route can be universal in both route modes" so that the name corresponds with the tested thing

* Ignore the PHPStan error

* Reset `InitializeTenancyByPath::$onFail` in PathIdentificationTest

* Simplify expression

* Use 'Tenancy (not) initialized.' in instead of `tenant()?->getTenantKey()` for better assertions

* Properly test removing tenant parameter

* Reset static properties in tests

* Correct comments in EarlyIdentificationTest

* Add comment

* Add detail to annotation

* Throw exception if payload isn't string or null in request data ID MW

* Fix code style (php-cs-fixer)

* Delete static `$kernelIdentificationSkipped` property, use `$request->attributes` instead

* Use 'default_route_mode' instead of 'default_to_tenant/universal_routes'

* Fix code style (php-cs-fixer)

* Make path identification MW, tenantParameterName and tenantRouteNamePrefix configurable in ReregisterUniversalRoutes

* Delete unused import

* Add `$passTenantParameterToRoute` to TenancyUrlGenerator

* Use `$passTenantParameterToRoute` in BootstrapperTest

* Bypass tenant parameter passing

* Improve TenancyUrlGenerator so that both ID methods work

* Fix code style (php-cs-fixer)

* Improve TenancyUrlGenerator readability

* Add modifyBehavior() to TenancyUrlGenerator

* Fix code style (php-cs-fixer)

* Improve comment

* Toggle route name prefixing in path/request data ID MW (route-level identification)

* Fix code style (php-cs-fixer)

* Add path identification MW config key, add `getTenantParameterName()` to ForgetTenantParameter

* Fix code style (php-cs-fixer)

* Fix modifyBehavior and routeBehaviorModificationBypassed

* Add type to `$parameters` parameter

* Split modifyBehavior into two methods, don't pass name and parameters by reference

* Update UrlBindingBootstrapper annotation

* Correct naming in tests (request data -> query string identification)

* Add info to annotation

* Pass arrays to the behavior modification methods instead of `mixed`

* Fix default value of static property in Fortify bootstrapper

* Fix code style (php-cs-fixer)

* Correct annotation

* Enable prefixing routes directly using path identification MW

* Test re-registration of routes with path ID MW

* Prefix names of routes directly using path ID MW

* Fix code style (php-cs-fixer)

* Add Livewire v3 integration example to TSP stub

* Prefix route name only if it's not prefixed already

* Rename ReregisterUniversalRoutes to ReregisterRoutesAsTenant

* Fix code style (php-cs-fixer)

* Improve ReregisterRoutesAsTenant

* Add/update TenancyUrlGenerator docblocks

* Update action name in comments/test names

* Update reregister action annotation

* Delete unused imports

* Improve comments

* Make method protected

* Improve TenancyUrlGenerator code

* Test bypass parameter removal

* Fix comment

* Update annotation

* Improve shouldReregisterRoute

* Fix typo, delete redundant comment

* Improve skipRoute

* Improve shouldBeSkipped

* Add and test `$passTenantParameterToRoutes`

* add a comment

* Fix typo in comment

* Pass array as $parameters in prepareRouteInputs

* Make path_identification_middleware an array

* Fix code style (php-cs-fixer)

* Fix ReregisterRouteAsTenant

* Move tenantParameterName and tenantRouteNamePrefix getting to PathIdentificationManager

* Make PathIdentificationManager properties `Closure|null`

* Fix code style (php-cs-fixer)

* Fix PathIdentificationManager

* Update comments

* Use foreach for dataset definition

* Extract repetitive inGlobalStack and routeHasMiddleware calls

* Refactor PathIdentificationManager

* Update TenancyUrlGenerator annotation

* Add $skippedRoutes, refactor ReregisterRoutesAsTenant

* Improve reregisterRoute

* Update re-register action annotation

* update test name

* Make PathIdentificationManager methods static again, update comments

* Add test comment

* Update ForgetTenantParameter annotation

* Improve route re-registration condition, add comment

* Change "re-register" to "clone"

* minor code improvements

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2023-08-03 00:23:26 +02:00
lukinovec
e61a26d604
Add L10 support to 4.x (merge 3.x to master) (#1071)
* exclude master from CI

* Add space after 'up' in 'docker-compose up-d' (#900)

* Fix ArgumentCountError on the TenantAssetsController (#894)

* Fix ArgumentCount exception on the TenantAssetsController when no `$path` is provided

* CS

* CS

* Handle null case explicitly

* code style

Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>

* Add support for nested tenant config override (#920)

* feat: add support for nested tenant config override

* test: ensure nested tenant values are mapped

* fix: typo mistake (#954)

* [3.x] Add Vite helper for tenancy (#956)

* Add Vite helper for tenancy

* Move Vite bundler to an Optional Feature

* Rename to foundation vite

* Add ViteBundlerTest

* Add missing end of file

* Update tests

* remove unnecessary end() call

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* rewrite ViteBundlerTest to phpunit syntax

* skip vite test in Laravel < 9

* convert ViteBundler to PHP 7 syntax

* remove import of nonexistent class in older Laravel versions

* remove import of Foundation\Vite in tests

* try to exclude Vite.php from coverage report

* remove typehint

* update channel name

* Cache crash fix (#1048)

* Don't prevent accessing missing Tenant attributes. (#1045)

* [3.x] L10 compatibility (#1065)

* Bump dependencies for Laravel 10

* Update GitHub Actions for Laravel 10

* ci: do not test L10 using PHP 7.3

* drop < L9 support

* use `dispatch_sync` instead of `dispatch_now`

* migrate phpunit configuration

* Update ci.yml

* drop laravel < 9 support

* misc L10 fixes, new docker image

* specify odbc version

* wip

* properly list php versions as strings

* minor changes

* Add `getValue($queryGrammar)` to raw query

* Clean up `isVersion8` code

* rewrite hasFailed assertion

* phpunit schema update

* Upgrade `doctrine/dbal`

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: lukinovec <lukinovec@gmail.com>

* Update ci.yml

* Fix code style (php-cs-fixer)

* Update dependencies

* Change invade version

* Delete ViteBundlerTest

* Fix PHPStan error

* Delete PHPStan error ignore

* Fix CONTRIBUTING.md

* Delete ViteBundler remains

* Bring back ViteBundler

* Convert ViteBundlerTest to Pest

* Update ci.yml

---------

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Bram Wubs <megawubs@users.noreply.github.com>
Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: George Bishop <email.georgebishop@gmail.com>
Co-authored-by: Anbuselvan Rocky <15264938+anburocky3@users.noreply.github.com>
Co-authored-by: Wilsen Hernández <13445515+wilsenhc@users.noreply.github.com>
Co-authored-by: Joel Stein <joel@mediatrix.digital>
Co-authored-by: Guilherme Saade <saade@outlook.com.br>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2023-02-20 23:47:10 +01:00
Abrar Ahmad
087733d5db
Allow defining the tenant connection template using array syntax in config (#1040)
* `template_tenant_connection` can be array or string

* Update TenantDatabaseManagerTest.php

* Update TenantDatabaseManagerTest.php

* Update TenantDatabaseManagerTest.php

* Update DatabaseConfig.php

* partial database config for template

* Update tests/TenantDatabaseManagerTest.php

Co-authored-by: lukinovec <lukinovec@gmail.com>

* update test name

* improve test names

* add comments

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2023-02-01 07:02:03 +01:00
Abrar Ahmad
bf504f4c79
[4.x] Use a dedicated DB connection for creating/deleting tenant databases (#946)
* create host connection for creating, deleting tenants

* purge connection and add more tests

* remove unused method

* Improvements

* test named

* remove host connection name config key

* Revert "remove host connection name config key"

This reverts commit 42acb823e8.

* Update DatabaseConfig.php

* Update assets/config.php

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* Update DatabaseConfig.php

* todo and comments

* remove debug code

* Update DatabaseConfig.php

* strict assertions

* Update TenantDatabaseManagerTest.php

* Update src/Database/DatabaseConfig.php

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* purge connection improvements

* Update DatabaseConfig.php

* Update DatabaseConfig.php

* Update DatabaseConfig.php

* improve comments

* remove "ensuring connection exists" check

* remove test because it's duplicate

* removing test because other two tests are using the same logic, so this test kinda already covered

* Update TenantDatabaseManagerTest.php

* Update DatabaseConfig.php

* Revert "Update TenantDatabaseManagerTest.php"

This reverts commit b8e0a1c982.

* add default

* Update src/Database/DatabaseConfig.php

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* update comment

* remove unness mysql config and add a comment

* tenancy_db_connection tenant config test

* Update TenantDatabaseManagerTest.php

* update test name and improve assertions

* typo

* change inline variable name

* Update TenantDatabaseManagerTest.php

* Update TenantDatabaseManagerTest.php

* add DB::purge() calls

* add new assertions [ci skip]

* Fix code style (php-cs-fixer)

* replace hostManager with manager

* fix test

* method rename

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2022-10-31 12:13:54 +01:00
Samuel Štancl
fe0a322b87 add public connection() method to the Tenant DB manager interface 2022-10-25 12:53:31 +02:00
Samuel Štancl
fa09e3a083 remove version checks 2022-09-29 16:02:08 +02:00
Abrar Ahmad
8e3b74f9d1
[4.x] Finish incomplete and missing tests (#947)
* complete test sqlite manager customize path

* complete test seed command works

* complete uniqe exists test

* Update SingleDatabaseTenancyTest.php

* refactor the ternary into if condition

* custom path

* simplify if condition

* random dir name

* Update SingleDatabaseTenancyTest.php

* Update CommandsTest.php

* prefix random DB name with custom_

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2022-09-24 04:08:44 +02:00
Samuel Štancl
40bf28c7d0 general refactor, move more classes under Database namespace 2022-08-27 03:17:16 +02:00
Samuel Štancl
f9c9d8615f Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
Samuel Štancl
b47c5549ef
[4.x] Migrate tests to Pest (#884)
* Add Pest dependencies

* Add base Pest file

* Convert test cases

* Remove non-compound imports

* Adopt expectation API

* Optimize uses

* Shift cleanup

* phpunit -> pest

* Fix tests in PR #884 PHPUnit to Pest Converter  (#885)

* fixed tests, remove method duplications, restore necessary inner classes

* Update CommandsTest.php

* temporary checks run on `shift-64622` on branch.

* fixed `TestSeeder` class not resolved

* fixed messed up names

* removed `uses` from individual files and add it in `Pest`

* extract tests to helpers

* use pest dataset

* Update AutomaticModeTest.php

* newline

* todo convention

* resolve reviews

* added `// todo@tests`

* remove shift branch from CI workflow

Co-authored-by: Samuel Štancl <samuel@archte.ch>

* check if I have write permission

* Convert newly added tests to Pest

Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
2022-07-22 19:26:59 +02:00
Abrar Ahmad
97ab483173
Completing PR #881 (#902)
* install PHP CS Fixer

* Fix styling

* remove StyleCI config

* use config from archtechx/template

* Fix styling

* added `php-cs-fixer`

* Update .php-cs-fixer.php

* added GitHub token

* Update ci.yml

* Update ci.yml

* Update ci.yml

* php-cs-fixer workflow same as template

Co-authored-by: Erik Gaal <me@erikgaal.nl>
Co-authored-by: erikgaal <erikgaal@users.noreply.github.com>
2022-07-20 15:28:45 +02:00
Nick Kitchen
cc6d4fe0dd
[4.x] Added support for Microsoft Sql Server (#715)
* added support for microsoft sql server database

* added support for microsoft sql server database

* trigger ci

* revert change

* trigger ci

* Try installing pdo_sqlsrv

* different approach for installing sqlsrv via pecl

* add dependencies

* add gnupg2

* Update Dockerfile

* try skipping msodbcsql17

* Update Dockerfile

* add dependency back

* update before installing

* try to add mssql

* mssql host

* TENANCY_TEST_MSSQL_HOST env var

* add env vars for mssql

* add sqlsrv vars to TestCase

* rename vars to SQLSRV [skip ci]

* MSSQL -> SQLSRV

Co-authored-by: Samuel Štancl <samuel@archte.ch>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2022-06-23 13:04:53 +02:00
Nathan Dunn
40bf576e00
[3.x] Update PostgreSQLSchemaManager to set correct config key value (#840)
* Update PostgreSQLSchemaManager to set correct config key value

* Update to use version_compare

* Update TenantDatabaseManagerTest

* Improve TenantDatabaseManagerTest

* Update TenantDatabaseManager
2022-04-08 03:13:29 +02:00
Samuel Štancl
73a4a3018c Improve queue tenancy 2021-12-31 18:10:03 +01:00
stancl
c8ed904d16 Apply fixes from StyleCI 2020-06-28 16:25:43 +00:00
Samuel Štancl
8bf673098b Fix guzzle issue 2020-06-28 18:24:41 +02:00
Samuel Štancl
579779b88b Move DatabaseManager 2020-05-30 15:38:29 +02:00
Samuel Štancl
2839f45196 Refactor models & config 2020-05-24 20:40:10 +02:00
stancl
6955512a6b Apply fixes from StyleCI 2020-05-22 09:01:31 +00:00
Samuel Štancl
fbe43fbb04 Restructure config 2020-05-21 15:05:05 +02:00
Samuel Štancl
15a7e52208 Get rid of tenant DB manager connection config 2020-05-21 14:47:29 +02:00
Samuel Štancl
e6e4548a22 Use % for CREATE % GRANT queries 2020-05-20 14:33:24 +02:00
Samuel Štancl
1833622170 Extract JobPipelines to a separate package 2020-05-15 18:26:08 +02:00
Samuel Štancl
1a8d150f2c Change bootstrappers namespace 2020-05-13 18:19:59 +02:00
Samuel Štancl
de53b81c0e Change default tenant model, write more tests, cleanup 2020-05-13 06:23:41 +02:00
Samuel Štancl
c32f229dd5 Refactor more old code and get tests to pass 2020-05-13 04:51:37 +02:00
Samuel Štancl
6962ec29b9 Get rid of v3 test namespace 2020-05-12 23:23:16 +02:00
Samuel Štancl
89936187ce Rewrite old tests 2020-05-12 23:22:40 +02:00
Samuel Štancl
3bb2759fe2
[3.x] DB users (#382)
* Initial draft

* Apply fixes from StyleCI

* Use CI on master branch too

* Pass correct argument to queued DB creators/deleters

* Apply fixes from StyleCI

* Remove new interface from MySQLDBManager

* Make phpunit run

* Apply fixes from StyleCI

* Fix static property

* Default databaseName

* Use database transactions for creating users & granting permissions

* Apply fixes from StyleCI

* Get old tests to pass

* Apply fixes from StyleCI

* Add tests for PermissionControlledMySQLDatabaseManager

* Apply fixes from StyleCI

* Write test for extra config, fix bug with extra config

* Apply fixes from StyleCI
2020-05-03 18:12:27 +02:00
Noor Adiana
d0023c482a
Add support for postgres schema (#237)
* Add support for postgres schema

* wip

* Apply fixes from StyleCI

* revert to db as default for pgsql

* Move separate_by to database

* Fixing testing

* Fixing style

* Reverted change

* Store string instead of Connection instance

* Remove use statement

* Add use statement for DB facade

* mysql -> pgsql

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2020-03-10 20:15:07 +01:00
Samuel Štancl
eb6cba8f1a Create MySQL/PostgreSQL DBs while using sqlite as the central DB driver 2019-09-21 11:11:36 +02:00
Samuel Štancl
f0dd99f099 Facade tests 2019-09-19 20:41:00 +02:00
Samuel Štancl
8565cc7acc Get multiple envs (redis/db) to run correctly 2019-09-17 19:39:57 +02:00
Samuel Štancl
9c9858e97e Merge branch 'master' of github.com:stancl/tenancy 2019-09-17 18:57:31 +02:00
Samuel Štancl
524530c8d5 TenantDatabaseManagerTest fully passes now 2019-09-17 18:57:19 +02:00
stancl
8f9120e723 Apply fixes from StyleCI 2019-09-17 15:59:51 +00:00
Samuel Štancl
5e9b421aa6 Fix Tenant DB manager tests 2019-09-17 17:59:40 +02:00
Samuel Štancl
1bfe4a7ea5
Apply fixes from StyleCI (#126) 2019-09-11 17:37:02 +02:00
Samuel Štancl
de54b5708c canCreate database 2019-09-08 16:52:10 +02:00
Samuel Štancl
2fd3662eb7
[1.8.0] Use strict types (#115)
* Use strict types

* Apply fixes from StyleCI

* Fix str_repeat

* Fix false json decode
2019-08-23 18:18:26 +02:00
stancl
84890cdd1e Apply fixes from StyleCI 2019-08-16 16:21:59 +00:00
Samuel Štancl
eceacd9422
Apply fixes from StyleCI (#80) 2019-08-02 20:01:10 +02:00