From c5d08f886ee90bf5dcaadf1afb249f0588f1171f Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 2 Nov 2023 17:07:33 +0000 Subject: [PATCH] Rename Config --- config/{docuware.php => laravel-docuware.php} | 0 src/Connectors/DocuWareStaticConnector.php | 4 +- src/DocuWareServiceProvider.php | 2 +- src/DocuWareUrl.php | 8 ++-- src/Exceptions/MethodNotAllowed.php | 2 +- src/Requests/Auth/GetLogoffRequest.php | 2 +- src/Requests/Auth/PostLogonRequest.php | 6 +-- src/Requests/Dialogs/GetDialogRequest.php | 4 +- src/Requests/Dialogs/GetDialogsRequest.php | 4 +- .../Document/GetDocumentCountRequest.php | 4 +- .../Document/GetDocumentDownloadRequest.php | 4 +- .../Document/GetDocumentPreviewRequest.php | 4 +- src/Requests/Document/GetDocumentRequest.php | 4 +- .../Document/GetDocumentsDownloadRequest.php | 4 +- src/Requests/Document/GetDocumentsRequest.php | 4 +- .../GetDocumentDownloadThumbnailRequest.php | 4 +- src/Requests/Fields/GetFieldsRequest.php | 4 +- .../FileCabinets/GetFileCabinetsRequest.php | 4 +- .../Organization/GetOrganizationRequest.php | 4 +- .../Organization/GetOrganizationsRequest.php | 4 +- src/Requests/Search/GetSearchRequest.php | 12 +++--- src/Requests/Sections/GetSectionsRequest.php | 4 +- .../SelectList/GetSelectListRequest.php | 4 +- src/Support/Auth.php | 8 ++-- src/Support/EnsureValidCredentials.php | 6 +-- src/Support/EnsureValidPassphrase.php | 2 +- tests/Feature/DocuWareConnectorTest.php | 4 +- tests/Feature/DocuWareTest.php | 22 +++++----- tests/Feature/Facades/DocuWare/CookieTest.php | 6 +-- .../Requests/Dialogs/GetDialogRequestTest.php | 14 +++---- .../Dialogs/GetDialogsRequestTest.php | 12 +++--- .../Document/GetDocumentCountRequestTest.php | 14 +++---- .../GetDocumentDownloadRequestTest.php | 12 +++--- .../GetDocumentPreviewRequestTest.php | 12 +++--- .../Document/GetDocumentRequestTest.php | 12 +++--- .../GetDocumentsDownloadRequestTest.php | 12 +++--- .../Document/GetDocumentsRequestTest.php | 18 ++++----- .../Document/PostDocumentRequestTest.php | 12 +++--- .../Document/PutDocumentFieldsRequestTest.php | 14 +++---- ...etDocumentDownloadThumbnailRequestTest.php | 12 +++--- .../Requests/Fields/GetFieldsRequestTest.php | 12 +++--- .../GetFileCabinetsRequestTest.php | 10 ++--- .../GetOrganizationRequestTest.php | 12 +++--- .../GetOrganizationsRequestTest.php | 10 ++--- .../Requests/Search/GetSearchRequestTest.php | 40 +++++++++---------- .../SelectList/GetSelectListRequest.php | 14 +++---- tests/Pest.php | 14 +++---- 47 files changed, 200 insertions(+), 200 deletions(-) rename config/{docuware.php => laravel-docuware.php} (100%) diff --git a/config/docuware.php b/config/laravel-docuware.php similarity index 100% rename from config/docuware.php rename to config/laravel-docuware.php diff --git a/src/Connectors/DocuWareStaticConnector.php b/src/Connectors/DocuWareStaticConnector.php index 5fc04732..e18ff25d 100644 --- a/src/Connectors/DocuWareStaticConnector.php +++ b/src/Connectors/DocuWareStaticConnector.php @@ -25,7 +25,7 @@ public function __construct() */ public function resolveBaseUrl(): string { - return config('docuware.credentials.url').'/DocuWare/Platform'; + return config('laravel-docuware.credentials.url').'/DocuWare/Platform'; } public function defaultHeaders(): array @@ -38,7 +38,7 @@ public function defaultHeaders(): array public function defaultConfig(): array { return [ - 'timeout' => config('docuware.timeout'), + 'timeout' => config('laravel-docuware.timeout'), 'cookies' => $this->cookieJar, ]; } diff --git a/src/DocuWareServiceProvider.php b/src/DocuWareServiceProvider.php index efb1d652..face78e2 100644 --- a/src/DocuWareServiceProvider.php +++ b/src/DocuWareServiceProvider.php @@ -12,7 +12,7 @@ public function configurePackage(Package $package): void { $package ->name('laravel-docuware') - ->hasConfigFile() + ->hasConfigFile('laravel-docuware') ->hasCommand(ListAuthCookie::class); } } diff --git a/src/DocuWareUrl.php b/src/DocuWareUrl.php index 30b6d587..8030fe15 100644 --- a/src/DocuWareUrl.php +++ b/src/DocuWareUrl.php @@ -52,8 +52,8 @@ public function make(): string $credentials = sprintf( 'User=%s\nPwd=%s', - config('docuware.credentials.username'), - config('docuware.credentials.password'), + config('laravel-docuware.credentials.username'), + config('laravel-docuware.credentials.password'), ); $lc = URL::formatWithBase64($credentials); @@ -79,7 +79,7 @@ public function make(): string } // Source: https://support.docuware.com/en-US/forums/help-with-technical-problems/ea9618df-c491-e911-80e7-0003ff59a7c6 - $key = utf8_encode(config('docuware.passphrase')); + $key = utf8_encode(config('laravel-docuware.passphrase')); $passphrase = hash('sha512', $key, true); $encryption_key = substr($passphrase, 0, 32); $iv = substr($passphrase, 32, 16); @@ -93,7 +93,7 @@ public function make(): string return sprintf( '%s/DocuWare/Platform/WebClient/Integration?ep=%s', - config('docuware.credentials.url'), + config('laravel-docuware.credentials.url'), URL::format($encrypted), ); } diff --git a/src/Exceptions/MethodNotAllowed.php b/src/Exceptions/MethodNotAllowed.php index e79d2032..0a55255d 100644 --- a/src/Exceptions/MethodNotAllowed.php +++ b/src/Exceptions/MethodNotAllowed.php @@ -8,6 +8,6 @@ final class MethodNotAllowed extends RuntimeException { public static function create(): self { - return new self('This method is not allowed on connection '.config('docuware.connection').'.'); + return new self('This method is not allowed on connection '.config('laravel-docuware.connection').'.'); } } diff --git a/src/Requests/Auth/GetLogoffRequest.php b/src/Requests/Auth/GetLogoffRequest.php index b20b65ed..dc931cc6 100644 --- a/src/Requests/Auth/GetLogoffRequest.php +++ b/src/Requests/Auth/GetLogoffRequest.php @@ -17,6 +17,6 @@ public function __construct() public function resolveEndpoint(): string { - return config('docuware.credentials.url').'/DocuWare/Platform/Account/Logoff'; + return config('laravel-docuware.credentials.url').'/DocuWare/Platform/Account/Logoff'; } } diff --git a/src/Requests/Auth/PostLogonRequest.php b/src/Requests/Auth/PostLogonRequest.php index 59996bff..7345c0dc 100644 --- a/src/Requests/Auth/PostLogonRequest.php +++ b/src/Requests/Auth/PostLogonRequest.php @@ -15,14 +15,14 @@ class PostLogonRequest extends SoloRequest implements HasBody public function resolveEndpoint(): string { - return config('docuware.credentials.url').'/DocuWare/Platform/Account/Logon'; + return config('laravel-docuware.credentials.url').'/DocuWare/Platform/Account/Logon'; } protected function defaultBody(): array { return [ - 'UserName' => config('docuware.credentials.username'), - 'Password' => config('docuware.credentials.password'), + 'UserName' => config('laravel-docuware.credentials.username'), + 'Password' => config('laravel-docuware.credentials.password'), 'RememberMe' => false, 'RedirectToMyselfInCaseOfError' => false, 'LicenseType' => null, diff --git a/src/Requests/Dialogs/GetDialogRequest.php b/src/Requests/Dialogs/GetDialogRequest.php index 4dadfcd7..22fbe358 100644 --- a/src/Requests/Dialogs/GetDialogRequest.php +++ b/src/Requests/Dialogs/GetDialogRequest.php @@ -30,12 +30,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Dialogs/GetDialogsRequest.php b/src/Requests/Dialogs/GetDialogsRequest.php index f21437dc..e8731fb1 100644 --- a/src/Requests/Dialogs/GetDialogsRequest.php +++ b/src/Requests/Dialogs/GetDialogsRequest.php @@ -29,12 +29,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Document/GetDocumentCountRequest.php b/src/Requests/Document/GetDocumentCountRequest.php index 863e0f94..8e6598ab 100644 --- a/src/Requests/Document/GetDocumentCountRequest.php +++ b/src/Requests/Document/GetDocumentCountRequest.php @@ -30,12 +30,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function defaultQuery(): array diff --git a/src/Requests/Document/GetDocumentDownloadRequest.php b/src/Requests/Document/GetDocumentDownloadRequest.php index 157720d2..f69f8c71 100644 --- a/src/Requests/Document/GetDocumentDownloadRequest.php +++ b/src/Requests/Document/GetDocumentDownloadRequest.php @@ -30,12 +30,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function defaultQuery(): array diff --git a/src/Requests/Document/GetDocumentPreviewRequest.php b/src/Requests/Document/GetDocumentPreviewRequest.php index 2afc2f7a..88efcb8a 100644 --- a/src/Requests/Document/GetDocumentPreviewRequest.php +++ b/src/Requests/Document/GetDocumentPreviewRequest.php @@ -30,12 +30,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Document/GetDocumentRequest.php b/src/Requests/Document/GetDocumentRequest.php index 8f07f406..4373067d 100644 --- a/src/Requests/Document/GetDocumentRequest.php +++ b/src/Requests/Document/GetDocumentRequest.php @@ -30,12 +30,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Document/GetDocumentsDownloadRequest.php b/src/Requests/Document/GetDocumentsDownloadRequest.php index 79ac015c..a40c9d79 100644 --- a/src/Requests/Document/GetDocumentsDownloadRequest.php +++ b/src/Requests/Document/GetDocumentsDownloadRequest.php @@ -41,12 +41,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function defaultQuery(): array diff --git a/src/Requests/Document/GetDocumentsRequest.php b/src/Requests/Document/GetDocumentsRequest.php index 6f6745ce..44d44e4d 100644 --- a/src/Requests/Document/GetDocumentsRequest.php +++ b/src/Requests/Document/GetDocumentsRequest.php @@ -29,12 +29,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php b/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php index a3910e12..be3ce1b1 100644 --- a/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php +++ b/src/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequest.php @@ -32,12 +32,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function defaultQuery(): array diff --git a/src/Requests/Fields/GetFieldsRequest.php b/src/Requests/Fields/GetFieldsRequest.php index c62fabcb..5e2e34fd 100644 --- a/src/Requests/Fields/GetFieldsRequest.php +++ b/src/Requests/Fields/GetFieldsRequest.php @@ -29,12 +29,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/FileCabinets/GetFileCabinetsRequest.php b/src/Requests/FileCabinets/GetFileCabinetsRequest.php index e3021f12..8c164d17 100644 --- a/src/Requests/FileCabinets/GetFileCabinetsRequest.php +++ b/src/Requests/FileCabinets/GetFileCabinetsRequest.php @@ -24,12 +24,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Organization/GetOrganizationRequest.php b/src/Requests/Organization/GetOrganizationRequest.php index 9b30864a..475170fb 100644 --- a/src/Requests/Organization/GetOrganizationRequest.php +++ b/src/Requests/Organization/GetOrganizationRequest.php @@ -29,12 +29,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Organization/GetOrganizationsRequest.php b/src/Requests/Organization/GetOrganizationsRequest.php index 31b072b9..1cb7b6fb 100644 --- a/src/Requests/Organization/GetOrganizationsRequest.php +++ b/src/Requests/Organization/GetOrganizationsRequest.php @@ -24,12 +24,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/Search/GetSearchRequest.php b/src/Requests/Search/GetSearchRequest.php index 84ac157d..4e51f32a 100644 --- a/src/Requests/Search/GetSearchRequest.php +++ b/src/Requests/Search/GetSearchRequest.php @@ -40,12 +40,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function defaultQuery(): array @@ -72,10 +72,10 @@ public function defaultBody(): array 'Direction' => $this->orderDirection, ], ], - 'Operation' => config('docuware.configurations.search.operation', 'And'), - 'ForceRefresh' => config('docuware.configurations.search.force_refresh', true), - 'IncludeSuggestions' => config('docuware.configurations.search.include_suggestions', false), - 'AdditionalResultFields' => config('docuware.configurations.search.additional_result_fields', []), + 'Operation' => config('laravel-docuware.configurations.search.operation', 'And'), + 'ForceRefresh' => config('laravel-docuware.configurations.search.force_refresh', true), + 'IncludeSuggestions' => config('laravel-docuware.configurations.search.include_suggestions', false), + 'AdditionalResultFields' => config('laravel-docuware.configurations.search.additional_result_fields', []), ]; } diff --git a/src/Requests/Sections/GetSectionsRequest.php b/src/Requests/Sections/GetSectionsRequest.php index 280bc877..eb961eea 100644 --- a/src/Requests/Sections/GetSectionsRequest.php +++ b/src/Requests/Sections/GetSectionsRequest.php @@ -37,12 +37,12 @@ public function defaultQuery(): array public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function createDtoFromResponse(Response $response): mixed diff --git a/src/Requests/SelectList/GetSelectListRequest.php b/src/Requests/SelectList/GetSelectListRequest.php index beb96318..e6dd8196 100644 --- a/src/Requests/SelectList/GetSelectListRequest.php +++ b/src/Requests/SelectList/GetSelectListRequest.php @@ -31,12 +31,12 @@ public function resolveEndpoint(): string public function resolveCacheDriver(): LaravelCacheDriver { - return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver'))); + return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver'))); } public function cacheExpiryInSeconds(): int { - return config('docuware.configurations.cache.lifetime_in_seconds', 3600); + return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600); } public function defaultQuery(): array diff --git a/src/Support/Auth.php b/src/Support/Auth.php index 4e64ba42..76ac725c 100644 --- a/src/Support/Auth.php +++ b/src/Support/Auth.php @@ -29,7 +29,7 @@ public static function store(CookieJar $cookies): void Arr::get($cookie, 'Name') => Arr::get($cookie, 'Value'), 'CreatedAt' => now()->toDateTimeString(), ], - now()->addMinutes(config('docuware.cookie_lifetime')), + now()->addMinutes(config('laravel-docuware.cookie_lifetime')), ); } @@ -60,11 +60,11 @@ public static function forget(): void public static function domain(): string { throw_if( - empty(config('docuware.credentials.url')), + empty(config('laravel-docuware.credentials.url')), UnableToFindUrlCredential::create(), ); - return Str::of(config('docuware.credentials.url')) + return Str::of(config('laravel-docuware.credentials.url')) ->after('//') ->beforeLast('/') ->__toString(); @@ -77,6 +77,6 @@ public static function check(): bool protected static function cacheDriver(): string { - return config('docuware.cache_driver', self::FALLBACK_CACHE_DRIVER); + return config('laravel-docuware.cache_driver', self::FALLBACK_CACHE_DRIVER); } } diff --git a/src/Support/EnsureValidCredentials.php b/src/Support/EnsureValidCredentials.php index d51e29e5..640275db 100644 --- a/src/Support/EnsureValidCredentials.php +++ b/src/Support/EnsureValidCredentials.php @@ -11,17 +11,17 @@ class EnsureValidCredentials public static function check(): void { throw_if( - empty(config('docuware.credentials.url')), + empty(config('laravel-docuware.credentials.url')), UnableToFindUrlCredential::create(), ); throw_if( - empty(config('docuware.credentials.username')), + empty(config('laravel-docuware.credentials.username')), UnableToFindUserCredential::create(), ); throw_if( - empty(config('docuware.credentials.password')), + empty(config('laravel-docuware.credentials.password')), UnableToFindPasswordCredential::create(), ); diff --git a/src/Support/EnsureValidPassphrase.php b/src/Support/EnsureValidPassphrase.php index 8a8c1db6..73a46cbd 100644 --- a/src/Support/EnsureValidPassphrase.php +++ b/src/Support/EnsureValidPassphrase.php @@ -9,7 +9,7 @@ class EnsureValidPassphrase public static function check(): void { throw_if( - empty(config('docuware.passphrase')), + empty(config('laravel-docuware.passphrase')), UnableToFindPassphrase::create(), ); } diff --git a/tests/Feature/DocuWareConnectorTest.php b/tests/Feature/DocuWareConnectorTest.php index f486fbb2..a2840acb 100644 --- a/tests/Feature/DocuWareConnectorTest.php +++ b/tests/Feature/DocuWareConnectorTest.php @@ -9,7 +9,7 @@ $timeout = Arr::get($connector->defaultConfig(), 'timeout'); //$cookies = Arr::get($connector->defaultConfig(), 'cookies'); - expect($timeout)->toBe(config('docuware.timeout')); + expect($timeout)->toBe(config('laravel-docuware.timeout')); //expect($cookies)->toBe(Auth::cookieJar()); })->group('connector'); @@ -17,7 +17,7 @@ it('returns the correct base url', function () { $connector = new DocuWareStaticConnector(); - expect($connector->resolveBaseUrl())->toBe(config('docuware.credentials.url').'/DocuWare/Platform'); + expect($connector->resolveBaseUrl())->toBe(config('laravel-docuware.credentials.url').'/DocuWare/Platform'); })->group('connector'); it('returns the correct default headers', function () { diff --git a/tests/Feature/DocuWareTest.php b/tests/Feature/DocuWareTest.php index 777d40d5..99a619c9 100644 --- a/tests/Feature/DocuWareTest.php +++ b/tests/Feature/DocuWareTest.php @@ -14,11 +14,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -27,8 +27,8 @@ it('can create encrypted url for a document in a file cabinet', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $documentId = config('docuware.tests.document_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $documentId = config('laravel-docuware.tests.document_id'); $url = (new DocuWare()) ->url() @@ -39,7 +39,7 @@ $endpoint = sprintf( '%s/DocuWare/Platform/WebClient/Integration?ep=', - config('docuware.credentials.url'), + config('laravel-docuware.credentials.url'), ); $this->assertStringStartsWith( @@ -51,8 +51,8 @@ it('can create encrypted url for a document in a basket', function () { Event::fake(); - $basketId = config('docuware.tests.basket_id'); - $documentId = config('docuware.tests.document_id'); + $basketId = config('laravel-docuware.tests.basket_id'); + $documentId = config('laravel-docuware.tests.document_id'); $url = (new DocuWare()) ->url() @@ -63,7 +63,7 @@ $endpoint = sprintf( '%s/DocuWare/Platform/WebClient/Integration?ep=', - config('docuware.credentials.url'), + config('laravel-docuware.credentials.url'), ); $this->assertStringStartsWith( diff --git a/tests/Feature/Facades/DocuWare/CookieTest.php b/tests/Feature/Facades/DocuWare/CookieTest.php index 6ce64ec6..cb733c40 100644 --- a/tests/Feature/Facades/DocuWare/CookieTest.php +++ b/tests/Feature/Facades/DocuWare/CookieTest.php @@ -6,9 +6,9 @@ it('cookie method', function () { - $url = config('docuware.credentials.url'); - $username = config('docuware.credentials.username'); - $password = config('docuware.credentials.password'); + $url = config('laravel-docuware.credentials.url'); + $username = config('laravel-docuware.credentials.username'); + $password = config('laravel-docuware.credentials.password'); $cookie = DocuWare::cookie($url, $username, $password); expect($cookie)->not()->toBeEmpty(); diff --git a/tests/Feature/Requests/Dialogs/GetDialogRequestTest.php b/tests/Feature/Requests/Dialogs/GetDialogRequestTest.php index a0c81c8c..45a20051 100644 --- a/tests/Feature/Requests/Dialogs/GetDialogRequestTest.php +++ b/tests/Feature/Requests/Dialogs/GetDialogRequestTest.php @@ -14,11 +14,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -27,8 +27,8 @@ it('can get a dialog', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $dialog = $this->connector->send(new GetDialogRequest($fileCabinetId, $dialogId))->dto(); diff --git a/tests/Feature/Requests/Dialogs/GetDialogsRequestTest.php b/tests/Feature/Requests/Dialogs/GetDialogsRequestTest.php index f070a6b5..da5e6389 100644 --- a/tests/Feature/Requests/Dialogs/GetDialogsRequestTest.php +++ b/tests/Feature/Requests/Dialogs/GetDialogsRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -28,7 +28,7 @@ it('can list dialogs for a file cabinet', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $dialogs = $this->connector->send(new GetDialogsRequest($fileCabinetId))->dto(); diff --git a/tests/Feature/Requests/Document/GetDocumentCountRequestTest.php b/tests/Feature/Requests/Document/GetDocumentCountRequestTest.php index 0b018432..3ce8e472 100644 --- a/tests/Feature/Requests/Document/GetDocumentCountRequestTest.php +++ b/tests/Feature/Requests/Document/GetDocumentCountRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -28,8 +28,8 @@ it('can get a total count of documents', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $document = $this->connector->send(new PostDocumentRequest( $fileCabinetId, diff --git a/tests/Feature/Requests/Document/GetDocumentDownloadRequestTest.php b/tests/Feature/Requests/Document/GetDocumentDownloadRequestTest.php index 25eab82d..85ac1943 100644 --- a/tests/Feature/Requests/Document/GetDocumentDownloadRequestTest.php +++ b/tests/Feature/Requests/Document/GetDocumentDownloadRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -28,7 +28,7 @@ it('can download a document', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $document = $this->connector->send(new PostDocumentRequest( $fileCabinetId, diff --git a/tests/Feature/Requests/Document/GetDocumentPreviewRequestTest.php b/tests/Feature/Requests/Document/GetDocumentPreviewRequestTest.php index 7a9bb682..817d3870 100644 --- a/tests/Feature/Requests/Document/GetDocumentPreviewRequestTest.php +++ b/tests/Feature/Requests/Document/GetDocumentPreviewRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -28,7 +28,7 @@ it('can preview a document image', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $document = $this->connector->send(new PostDocumentRequest( $fileCabinetId, diff --git a/tests/Feature/Requests/Document/GetDocumentRequestTest.php b/tests/Feature/Requests/Document/GetDocumentRequestTest.php index bfb56c52..e0c1617d 100644 --- a/tests/Feature/Requests/Document/GetDocumentRequestTest.php +++ b/tests/Feature/Requests/Document/GetDocumentRequestTest.php @@ -16,11 +16,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -29,7 +29,7 @@ it('can show a document', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $document = $this->connector->send(new PostDocumentRequest( $fileCabinetId, diff --git a/tests/Feature/Requests/Document/GetDocumentsDownloadRequestTest.php b/tests/Feature/Requests/Document/GetDocumentsDownloadRequestTest.php index c86cb158..335d2fdb 100644 --- a/tests/Feature/Requests/Document/GetDocumentsDownloadRequestTest.php +++ b/tests/Feature/Requests/Document/GetDocumentsDownloadRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -28,7 +28,7 @@ it('can download multiple documents', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $document1 = $this->connector->send(new PostDocumentRequest( $fileCabinetId, diff --git a/tests/Feature/Requests/Document/GetDocumentsRequestTest.php b/tests/Feature/Requests/Document/GetDocumentsRequestTest.php index 6f66af44..9021184f 100644 --- a/tests/Feature/Requests/Document/GetDocumentsRequestTest.php +++ b/tests/Feature/Requests/Document/GetDocumentsRequestTest.php @@ -16,11 +16,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -30,25 +30,25 @@ Event::fake(); $this->connector->send(new PostDocumentRequest( - config('docuware.tests.file_cabinet_id'), + config('laravel-docuware.tests.file_cabinet_id'), '::fake-file-content::', 'example.txt' ))->dto(); $this->connector->send(new PostDocumentRequest( - config('docuware.tests.file_cabinet_id'), + config('laravel-docuware.tests.file_cabinet_id'), '::fake-file-content::', 'example.txt' ))->dto(); $documents = $this->connector->send(new GetDocumentsRequest( - config('docuware.tests.file_cabinet_id') + config('laravel-docuware.tests.file_cabinet_id') ))->dto(); foreach ($documents as $document) { $this->assertInstanceOf(Document::class, $document); $this->connector->send(new DeleteDocumentRequest( - config('docuware.tests.file_cabinet_id'), + config('laravel-docuware.tests.file_cabinet_id'), $document->id, ))->dto(); } diff --git a/tests/Feature/Requests/Document/PostDocumentRequestTest.php b/tests/Feature/Requests/Document/PostDocumentRequestTest.php index dfc5d182..d3f6fab1 100644 --- a/tests/Feature/Requests/Document/PostDocumentRequestTest.php +++ b/tests/Feature/Requests/Document/PostDocumentRequestTest.php @@ -17,11 +17,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -30,7 +30,7 @@ it('can upload document with index values and delete it', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $fileContent = '::fake-file-content::'; $fileName = 'example.txt'; diff --git a/tests/Feature/Requests/Document/PutDocumentFieldsRequestTest.php b/tests/Feature/Requests/Document/PutDocumentFieldsRequestTest.php index 784d6585..bee2b2ea 100644 --- a/tests/Feature/Requests/Document/PutDocumentFieldsRequestTest.php +++ b/tests/Feature/Requests/Document/PutDocumentFieldsRequestTest.php @@ -16,11 +16,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -29,7 +29,7 @@ it('can update a document value', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $newValue = 'laravel-docuware'; $document = $this->connector->send(new PostDocumentRequest( @@ -56,7 +56,7 @@ it('can update multiple document values', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $values = [ 'UUID' => 'laravel-docuware', 'DOCUMENT_LABEL' => 'laravel-docuware-2', diff --git a/tests/Feature/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php b/tests/Feature/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php index f267abd7..d8b5b9fa 100644 --- a/tests/Feature/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php +++ b/tests/Feature/Requests/Document/Thumbnail/GetDocumentDownloadThumbnailRequestTest.php @@ -16,11 +16,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -29,7 +29,7 @@ it('can download a document thumbnail', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $document = $this->connector->send(new PostDocumentRequest( $fileCabinetId, diff --git a/tests/Feature/Requests/Fields/GetFieldsRequestTest.php b/tests/Feature/Requests/Fields/GetFieldsRequestTest.php index 1c82e91b..d493efa1 100644 --- a/tests/Feature/Requests/Fields/GetFieldsRequestTest.php +++ b/tests/Feature/Requests/Fields/GetFieldsRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -28,7 +28,7 @@ it('can list fields for a file cabinet', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); $fields = $this->connector->send(new GetFieldsRequest($fileCabinetId))->dto(); diff --git a/tests/Feature/Requests/FileCabinets/GetFileCabinetsRequestTest.php b/tests/Feature/Requests/FileCabinets/GetFileCabinetsRequestTest.php index 23354dd9..89cefc0d 100644 --- a/tests/Feature/Requests/FileCabinets/GetFileCabinetsRequestTest.php +++ b/tests/Feature/Requests/FileCabinets/GetFileCabinetsRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); diff --git a/tests/Feature/Requests/Organization/GetOrganizationRequestTest.php b/tests/Feature/Requests/Organization/GetOrganizationRequestTest.php index 6bf6201e..8dc0c54e 100644 --- a/tests/Feature/Requests/Organization/GetOrganizationRequestTest.php +++ b/tests/Feature/Requests/Organization/GetOrganizationRequestTest.php @@ -14,11 +14,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -27,7 +27,7 @@ it('can get an organization', function () { Event::fake(); - $orgID = config('docuware.tests.organization_id'); + $orgID = config('laravel-docuware.tests.organization_id'); $organization = $this->connector->send(new GetOrganizationRequest($orgID))->dto(); diff --git a/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php b/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php index 974fd548..f3f5186a 100644 --- a/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php +++ b/tests/Feature/Requests/Organization/GetOrganizationsRequestTest.php @@ -15,11 +15,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); diff --git a/tests/Feature/Requests/Search/GetSearchRequestTest.php b/tests/Feature/Requests/Search/GetSearchRequestTest.php index 0cd48b7a..d3e48f18 100644 --- a/tests/Feature/Requests/Search/GetSearchRequestTest.php +++ b/tests/Feature/Requests/Search/GetSearchRequestTest.php @@ -16,11 +16,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -29,8 +29,8 @@ it('can search documents', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $paginatorRequest = (new DocuWare()) ->searchRequestBuilder() @@ -54,8 +54,8 @@ it('can\'t search documents by more than two dates', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $this->expectException(UnableToSearch::class); @@ -79,8 +79,8 @@ it('can override search documents dates filter by using same operator', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $paginatorRequest = (new DocuWare()) ->searchRequestBuilder() @@ -105,8 +105,8 @@ it('can override search documents dates filter by using equal operator', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $paginatorRequest = (new DocuWare()) ->searchRequestBuilder() @@ -130,8 +130,8 @@ it('can\'t search documents by diverged date range', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $this->expectException(UnableToSearch::class); @@ -154,8 +154,8 @@ it('can search documents dates filter in future', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $paginatorRequest = (new DocuWare()) ->searchRequestBuilder() @@ -178,8 +178,8 @@ it('can search documents dates filter in past', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $paginatorRequest = (new DocuWare()) ->searchRequestBuilder() @@ -203,7 +203,7 @@ Event::fake(); $fileCabinetIds = [ - config('docuware.tests.file_cabinet_id'), + config('laravel-docuware.tests.file_cabinet_id'), ]; $paginatorRequest = (new DocuWare()) diff --git a/tests/Feature/Requests/SelectList/GetSelectListRequest.php b/tests/Feature/Requests/SelectList/GetSelectListRequest.php index bd1a86e6..3510abbe 100644 --- a/tests/Feature/Requests/SelectList/GetSelectListRequest.php +++ b/tests/Feature/Requests/SelectList/GetSelectListRequest.php @@ -16,11 +16,11 @@ EnsureValidCookie::check(); $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $this->connector = new DocuWareStaticConnector($config); @@ -29,8 +29,8 @@ it('can list values for a select list', function () { Event::fake(); - $fileCabinetId = config('docuware.tests.file_cabinet_id'); - $dialogId = config('docuware.tests.dialog_id'); + $fileCabinetId = config('laravel-docuware.tests.file_cabinet_id'); + $dialogId = config('laravel-docuware.tests.dialog_id'); $fieldName = 'UUID'; $document = $this->connector->send(new PostDocumentRequest( diff --git a/tests/Pest.php b/tests/Pest.php index f2fcf2cd..7af6acc1 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -10,22 +10,22 @@ beforeAll(function () { $config = Config::make([ - 'url' => config('docuware.credentials.url'), - 'cookie' => config('docuware.cookies'), - 'cache_driver' => config('docuware.configurations.cache.driver'), - 'cache_lifetime_in_seconds' => config('docuware.configurations.cache.lifetime_in_seconds'), - 'request_timeout_in_seconds' => config('docuware.timeout'), + 'url' => config('laravel-docuware.credentials.url'), + 'cookie' => config('laravel-docuware.cookies'), + 'cache_driver' => config('laravel-docuware.configurations.cache.driver'), + 'cache_lifetime_in_seconds' => config('laravel-docuware.configurations.cache.lifetime_in_seconds'), + 'request_timeout_in_seconds' => config('laravel-docuware.timeout'), ]); $connector = new DocuWareStaticConnector($config); $documents = $connector->send(new GetDocumentsRequest( - config('docuware.tests.file_cabinet_id') + config('laravel-docuware.tests.file_cabinet_id') ))->dto(); foreach ($documents as $document) { $connector->send(new DeleteDocumentRequest( - config('docuware.tests.file_cabinet_id'), + config('laravel-docuware.tests.file_cabinet_id'), $document->id, ))->dto(); }