1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 06:54:03 +00:00
Commit graph

19 commits

Author SHA1 Message Date
lukinovec
af14d403c5 Delete extra newline, fix comment inconsistency
Use "userName" in the channel helper test's comment for consistency (the channel name uses "userName", the comment used "userId", fixed that)
2026-07-10 15:54:27 +02:00
lukinovec
d80fed1468 Remove stale $tenantBroadcasters mention 2026-07-10 15:23:57 +02:00
lukinovec
2a0464d694 Resolve (and cache) tenant broadcasters once per tenancy initialization instead of re-resolving them every time
TenancyBroadcastManager now overrides resolve() (only to pass the central channels to the newly resolved broadcasters) instead of get(), so broadcasters stay cached for the duration of the tenant's context.

Remove TenancyBroadcastManager::$tenantBroadcasters -- all broadcasters now inherit the central channels, so even custom drivers work without any additional configuration/registration.

Channels registered via Broadcast::channel() in tenant context are no longer lost on subsequent broadcaster retrievals (e.g. during /broadcasting/auth). Added a dedicated test for this,
2026-07-10 15:06:03 +02:00
lukinovec
614344af52 Add test for reverting the bound broadcaster when tenancy ends
The original BroadcastingTest file had a very similar test that was removed during a refactor. Added it back and improved it (used the testing broadcaster instead of NullBroadcaster, improved the test's name comments)
2026-06-29 13:03:00 +02:00
lukinovec
d885659a16 Use toEqualCanonicalizing instead of toBe for custom creators
The order of the array items shouldn't matter.
2026-04-15 11:20:59 +02:00
lukinovec
7db486d1b9 Extract cleanup in broadcasting config test file 2026-04-15 11:12:59 +02:00
lukinovec
a7acd07e70 Reset BroadcastingConfigBootstrapper::$mapPresets in tests 2026-04-15 10:44:18 +02:00
lukinovec
f3652a8509 Make with() formatting consistent 2026-04-15 10:18:29 +02:00
lukinovec
a3c556870a Add regression test for credentialsMap merge order 2026-04-15 10:16:22 +02:00
lukinovec
7af2b8acb4 Improve BroadcastManager instance checks 2026-04-14 09:26:34 +02:00
lukinovec
20d494f4c6 Reset BroadcastingConfigBootstrapper::$broadcaster in tests 2026-04-14 09:09:46 +02:00
lukinovec
a247bb0b9e Correct config bootstrapper test comment 2026-04-13 15:48:03 +02:00
lukinovec
9ab0a729d6
Fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-13 15:28:11 +02:00
lukinovec
f8528fc9ac Add 'reverb' to TenancyBroadcastManager::$tenantBroadcasters 2026-04-03 15:54:25 +02:00
lukinovec
29dd23db61 BroadcastingConfigBootstrapperTest: add 'reverb' driver to datasets
Adding 'reverb' to `TenancyBroadcastManager::$tenantBroadcasters` will make these tests pass.
2026-04-03 11:26:46 +02:00
lukinovec
fc45e09dc9 Update BroadcastingConfigBootstrapperTest
Tests now use datasets with all drivers that are in `TenancyBroadcastManager::$tenantBroadcasters` by default plus the custom driver. Also add assertions for updating the tenant properties/config in tenant context.
2026-04-03 11:17:06 +02:00
lukinovec
b2add06a98 Delete BroadcastingTest
Tests from BroadcastingTest moved to the appropriate bootstrapper test files. The new tenant credentials test has assertions equal to both the original property -> config mapping test and the config -> credentials test.
2026-04-02 16:14:53 +02:00
lukinovec
6e67ddf7a5
Resolve test to-dos (#45)
* Only retrieve domains if the relationship and the domains table exist (DomianTenantResolver)

* Resolve todo, add other todos

* Use constructor promotion in DeleteDomains

* Fix imports + domain deletion test

* Confirm that turning on resolver caching doesn't break the tests

* Fix Tenant model imports

* Fix code style (php-cs-fixer)

* remove runtime schema check

* temp: enable resolver cache

* make 'autoincrement ids are supported' pass

* disable resolver cache

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
2024-04-18 00:22:03 +02:00
Samuel Štancl
eecf6f21c8
Cache prefixing logic rewrite, session scoping improvements, tests refactor (#43)
* Run cache tests on all supported drivers

* update ci healthcheck for memcached

* remove memcached healthcheck

* fix typos in test comments, expand internal.md [ci skip]

* add empty line [ci skip]

* switch to using $store->setPrefix()

* add dynamodb

* refactor try-finally to try-catch

* remove unnecessary clearResolvedInstances() call

* add dual Cache:: and cache() assertions

* add apc

* Flush APCu cache in test setup

* Revert "add dual Cache:: and cache() assertions"

This reverts commit a0bab162fbe2dd0d25e7056ceca4fb7ce54efc77.

* phpstan fix

* Add logic for scoping 'file' disks to FilesystemTenancyBootstrapper

* minor changes, add todos

* refactor how the session.connection is used in the DB session bootstrapper

* add session forgery prevention logic to the db session bootstrapper

* only use the fs bootstrapper for file disk in 'cache data is separated' dataset

* minor session scoping test changes

* Add session scoping logic to FilesystemTenancyBootstrapper, correctly update disk roots even with storage_path_tenancy disabled

* Fix code style (php-cs-fixer)

* update docblock

* make not-null check more explicit

* separate bootstrapper tests, fix swapped test names for two tests

* refactor cache bootstrapper tests

* resolve global cache todo

* expand tests: session separation tests, more filesystem separation assertions; change prefix_base-type config keys to templates/formats

* add apc session scoping test, various session separation bugfixes

* phpstan + minor logic fixes

* prefix_format -> prefix

* fix database session separation test

* revert composer.json changes, update laravel dependencies to expected next release

* only run session scoping logic in cache bootstrapper for redis, memcached, dynamodb, apc; update gitattributes

* tenancy.central_domains -> tenancy.identification.central_domains

* db session separation test: add datasets

---------

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
2024-04-09 20:40:27 +02:00