Changeset View
Changeset View
Standalone View
Standalone View
src/tests/TestCase.php
Show All 18 Lines | protected static function useAdminUrl(): void | ||||
// we can also just call post/get/whatever with full url | // we can also just call post/get/whatever with full url | ||||
\config(['app.url' => str_replace('//', '//admin.', \config('app.url'))]); | \config(['app.url' => str_replace('//', '//admin.', \config('app.url'))]); | ||||
url()->forceRootUrl(config('app.url')); | url()->forceRootUrl(config('app.url')); | ||||
} | } | ||||
/** | /** | ||||
* Set baseURL to the normal location | * Set baseURL to the normal location | ||||
*/ | */ | ||||
protected static function useServicesUrl(): void | protected static function useNormalUrl(): void | ||||
{ | { | ||||
// This will set base URL for all tests in a file. | // This will set base URL for all tests in a file. | ||||
\config(['app.url' => 'https://' . \config('app.domain'))]); | \config(['app.url' => 'https://' . \config('app.domain')]); | ||||
url()->forceRootUrl(config('app.url')); | url()->forceRootUrl(config('app.url')); | ||||
} | } | ||||
/** | /** | ||||
* Set baseURL to the services location | * Set baseURL to the services location | ||||
*/ | */ | ||||
protected static function useServicesUrl(): void | protected static function useServicesUrl(): void | ||||
{ | { | ||||
// This will set base URL for all tests in a file. | // This will set base URL for all tests in a file. | ||||
\config(['app.url' => str_replace('//', '//services.', \config('app.url'))]); | \config(['app.url' => str_replace('//', '//services.', \config('app.url'))]); | ||||
url()->forceRootUrl(config('app.url')); | url()->forceRootUrl(config('app.url')); | ||||
} | } | ||||
} | } |