mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-10-29 16:09:29 +03:00 
			
		
		
		
	Fixed failing webhook test cases
This commit is contained in:
		| @@ -79,7 +79,6 @@ class DispatchWebhookJob implements ShouldQueue | |||||||
|                 ->withOptions(['allow_redirects' => ['strict' => true]]) |                 ->withOptions(['allow_redirects' => ['strict' => true]]) | ||||||
|                 ->timeout($this->webhook->timeout) |                 ->timeout($this->webhook->timeout) | ||||||
|                 ->post($this->webhook->endpoint, $webhookData); |                 ->post($this->webhook->endpoint, $webhookData); | ||||||
|  |  | ||||||
|         } catch (\Exception $exception) { |         } catch (\Exception $exception) { | ||||||
|             $lastError = $exception->getMessage(); |             $lastError = $exception->getMessage(); | ||||||
|             Log::error("Webhook call to endpoint {$this->webhook->endpoint} failed with error \"{$lastError}\""); |             Log::error("Webhook call to endpoint {$this->webhook->endpoint} failed with error \"{$lastError}\""); | ||||||
|   | |||||||
| @@ -39,6 +39,7 @@ class WebhookManagementTest extends TestCase | |||||||
|             'endpoint' => 'https://example.com/webhook', |             'endpoint' => 'https://example.com/webhook', | ||||||
|             'events'   => ['all'], |             'events'   => ['all'], | ||||||
|             'active'   => 'true', |             'active'   => 'true', | ||||||
|  |             'timeout'  => 4, | ||||||
|         ]); |         ]); | ||||||
|  |  | ||||||
|         $resp->assertRedirect('/settings/webhooks'); |         $resp->assertRedirect('/settings/webhooks'); | ||||||
| @@ -51,6 +52,7 @@ class WebhookManagementTest extends TestCase | |||||||
|             'name'     => 'My first webhook', |             'name'     => 'My first webhook', | ||||||
|             'endpoint' => 'https://example.com/webhook', |             'endpoint' => 'https://example.com/webhook', | ||||||
|             'active'   => true, |             'active'   => true, | ||||||
|  |             'timeout'  => 4, | ||||||
|         ]); |         ]); | ||||||
|  |  | ||||||
|         /** @var Webhook $webhook */ |         /** @var Webhook $webhook */ | ||||||
| @@ -82,6 +84,7 @@ class WebhookManagementTest extends TestCase | |||||||
|             'endpoint' => 'https://example.com/updated-webhook', |             'endpoint' => 'https://example.com/updated-webhook', | ||||||
|             'events'   => [ActivityType::PAGE_CREATE, ActivityType::PAGE_UPDATE], |             'events'   => [ActivityType::PAGE_CREATE, ActivityType::PAGE_UPDATE], | ||||||
|             'active'   => 'true', |             'active'   => 'true', | ||||||
|  |             'timeout'  => 5 | ||||||
|         ]); |         ]); | ||||||
|         $resp->assertRedirect('/settings/webhooks'); |         $resp->assertRedirect('/settings/webhooks'); | ||||||
|  |  | ||||||
| @@ -93,6 +96,7 @@ class WebhookManagementTest extends TestCase | |||||||
|             'name'     => 'My updated webhook', |             'name'     => 'My updated webhook', | ||||||
|             'endpoint' => 'https://example.com/updated-webhook', |             'endpoint' => 'https://example.com/updated-webhook', | ||||||
|             'active'   => true, |             'active'   => true, | ||||||
|  |             'timeout'  => 5, | ||||||
|         ]); |         ]); | ||||||
|  |  | ||||||
|         $trackedEvents = $webhook->trackedEvents()->get(); |         $trackedEvents = $webhook->trackedEvents()->get(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user