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

wip broadcasting test fixes

This commit is contained in:
Samuel Štancl 2024-10-03 21:34:05 +02:00
parent a37dc9b449
commit a52efe5cf0
2 changed files with 7 additions and 3 deletions

View file

@ -69,6 +69,8 @@
"docker-restart": "docker-compose down && docker-compose up -d", "docker-restart": "docker-compose down && docker-compose up -d",
"docker-rebuild": "PHP_VERSION=8.3 docker-compose up -d --no-deps --build", "docker-rebuild": "PHP_VERSION=8.3 docker-compose up -d --no-deps --build",
"docker-m1": "ln -s docker-compose-m1.override.yml docker-compose.override.yml", "docker-m1": "ln -s docker-compose-m1.override.yml docker-compose.override.yml",
"testbench-unlink": "rm ./vendor/orchestra/testbench-core/laravel/vendor",
"testbench-link": "ln -s vendor ./vendor/orchestra/testbench-core/laravel/vendor",
"coverage": "open coverage/phpunit/html/index.html", "coverage": "open coverage/phpunit/html/index.html",
"phpstan": "vendor/bin/phpstan", "phpstan": "vendor/bin/phpstan",
"phpstan-pro": "vendor/bin/phpstan --pro", "phpstan-pro": "vendor/bin/phpstan --pro",

View file

@ -136,9 +136,11 @@ test('broadcasting channel helpers register channels correctly', function() {
// Tenant channel registered its name is correctly prefixed ("{tenant}.user.{userId}") // Tenant channel registered its name is correctly prefixed ("{tenant}.user.{userId}")
$tenantChannelClosure = $getChannels()->first(fn ($closure, $name) => $name === "{tenant}.$channelName"); $tenantChannelClosure = $getChannels()->first(fn ($closure, $name) => $name === "{tenant}.$channelName");
expect($tenantChannelClosure) expect($tenantChannelClosure)->toBe($centralChannelClosure);
->not()->toBeNull() // Channel registered
->not()->toBe($centralChannelClosure); // The tenant channel closure is different after the auth user, it accepts the tenant ID // todo: fix tests from below here as the closure is now NOT modified, the $tenant parameter is expected (when additional parameters are used) and kept
// and the universal_channel() helper was removed (get rid of tests related to testing the helper's behavior, but tests which use universal channels should
// be kept -- the two channels should just be registered by hand per docs instead of using the now removed helper)
// The tenant channels are prefixed with '{tenant}.' // The tenant channels are prefixed with '{tenant}.'
// They accept the tenant key, but their closures only run in tenant context when tenancy is initialized // They accept the tenant key, but their closures only run in tenant context when tenancy is initialized