1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:14:04 +00:00
tenancy/tests
lukinovec 0f892f1585
Make tenants able to have custom mail credentials (#989)
* Replace MailManager singleton with an instance of a custom mail manager which always resolves the mailers instead of getting the cached ones

* Fix code style (php-cs-fixer)

* Add MailTenancyBootstrapper

* Add MailTenancyBootstrapper to tenancy.bootstrappers config (commented out)

* Fix code style (php-cs-fixer)

* Make credentials map a public static property

* Always resolve only the mailers specified in the mailersToNotCache public static property

* Fix typo in comment

* Update TenancyServiceProvider comment

* add todo

* Add comments to TenancyMailManager, rename property

* Remove the configKey array check

* Simplify bootstrap method

* Change $credentialsMap so that config keys are the keys, and the tenant property names are the values

* Rename $mailersToAlwaysResolve to $tenantMailers

* Update comment

* Update comment

* Rename variable in TenancyServiceProvider comment

* Scaffold tests

* Update comments after review

* Uncomment MailTenancyBootstrapper in config

* Use array_key_exists instead of null check

* Split config logic into methods

* Update mapping credentials

* Add tests for the added logic

* Fix code style (php-cs-fixer)

* Delete default 'smtp' mailer in $tenantMailers

* Add separate method to pick the appropriate mail credentials map preset

* Specify test name

* Move mail bootstrapper tests to BootstrapperTest

* Depend less on the default mailer by adding a static `$mailer` property

* Use static property for map presets

* Comment out MailTenancyBootstrapper from config

* Add return types to MailTenancyBootstrapper methods

* Update test name

* Move MailManager extension to MailTenancyBootstrapper

* Fix code style (php-cs-fixer)

* Update config reverting test

* Use `invade()` instead of ReflectionClass

* Fix constructor parameter formatting

* Delete TenancyMailManager, update tests

* Add return type

* Update comment

* Update MailTest

* Delete `group('mailer')`

* Delete bindNewMailManagerInstance()

* Delete remaining `group('mailer')`

* Fix comment

* Fix comment

Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
2023-01-04 02:12:25 +01:00
..
Etc [4.x] Configure attributes for synced resources when creating models (#915) 2022-11-03 17:51:29 +01:00
Features Pull 3.x changes into master (#922) 2022-08-22 17:59:43 +02:00
ActionTest.php [4.x] Storage::url() support (modified #689) (#909) 2022-09-28 05:09:45 +02:00
AutomaticModeTest.php get down to 59 phpstan errors 2022-09-29 22:20:55 +02:00
BatchTest.php remove version checks 2022-09-29 16:02:08 +02:00
BootstrapperTest.php Make tenants able to have custom mail credentials (#989) 2023-01-04 02:12:25 +01:00
CachedTenantResolverTest.php Add identification section to config, refactor static properties 2022-10-01 20:01:18 +02:00
CacheManagerTest.php Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
CombinedDomainAndSubdomainIdentificationTest.php Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
CommandsTest.php Use the hardcoded default path in TenantDump only if the path isn't configured (#1019) 2022-11-23 13:12:29 +01:00
DatabasePreparationTest.php add public connection() method to the Tenant DB manager interface 2022-10-25 12:53:31 +02:00
DatabaseUsersTest.php general refactor, move more classes under Database namespace 2022-08-27 03:17:16 +02:00
DebuggableTest.php wip Debuggable trait 2022-07-28 15:14:29 +02:00
DeleteDomainsJobTest.php Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
DomainTest.php Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
EventListenerTest.php get phpstan errors down from 252 to 189 2022-08-30 05:44:23 +02:00
GlobalCacheTest.php phpstan, global_cache, resolver improvements, InitializationHelpers trait 2022-09-29 02:47:13 +02:00
MailTest.php Make tenants able to have custom mail credentials (#989) 2023-01-04 02:12:25 +01:00
MaintenanceModeTest.php [4.x] Update commands CLI outputs (#968) 2022-10-18 19:11:57 +02:00
ManualModeTest.php Manual mode improvements (use correct event type, add new listeners) (#1013) 2022-11-25 03:09:31 +01:00
PathIdentificationTest.php Add identification section to config, refactor static properties 2022-10-01 20:01:18 +02:00
PendingTenantsTest.php Improve code of pending tenants (#1025) 2022-11-29 09:31:07 +01:00
Pest.php Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
QueueTest.php added $this->mockConsoleOutput (#907) 2022-07-27 01:35:55 +02:00
RequestDataIdentificationTest.php Add cookie option on Initialize Tenancy by Request identification (#980) 2022-10-18 13:52:16 +02:00
ResourceSyncingTest.php [4.x] Resource syncing improvements (#992) 2022-11-09 13:00:54 +01:00
ScopeSessionsTest.php Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
SingleDatabaseTenancyTest.php Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
SubdomainTest.php Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
TenantAssetTest.php Add identification section to config, refactor static properties 2022-10-01 20:01:18 +02:00
TenantAwareCommandTest.php Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00
TenantDatabaseManagerTest.php [4.x] Use a dedicated DB connection for creating/deleting tenant databases (#946) 2022-10-31 12:13:54 +01:00
TenantModelTest.php Fix #998, centralize config used by BelongsToTenant and HasDomains 2022-11-10 16:03:13 +01:00
TenantUserImpersonationTest.php Add session state when impersonating tenant (#1029) 2022-12-17 02:08:03 +01:00
TestCase.php Make tenants able to have custom mail credentials (#989) 2023-01-04 02:12:25 +01:00
UniversalRouteTest.php Refactor tests to use pest() helper 2022-07-23 01:16:50 +02:00