Skip to content

Commit

Permalink
Closes #6438: Adapt the URL for the job so the SaaS uses the correct …
Browse files Browse the repository at this point in the history
…one (#6455)
  • Loading branch information
Miraeld authored and wordpressfan committed Mar 15, 2024
1 parent ad5be3d commit 0357eea
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 4 deletions.
2 changes: 1 addition & 1 deletion inc/Engine/Common/JobManager/APIHandler/APIClient.php
Expand Up @@ -44,7 +44,7 @@ public function add_to_queue( string $url, array $options ): array {
'nowprocket' => 1,
'no_optimize' => 1,
],
$url
user_trailingslashit( $url )
),
'config' => $options,
],
Expand Down
Expand Up @@ -7,7 +7,7 @@
'queue_name' => 'EU',
'is_mobile' => false,
'now' => '2023-10-11 20:21:00',
'result' => true
'result' => true,
],
'expected' => [
'item' => [
Expand All @@ -29,7 +29,7 @@
'queue_name' => '',
'is_mobile' => false,
'now' => '2023-10-11 20:21:00',
'result' => true
'result' => true,
],
'expected' => [
'item' => [
Expand All @@ -43,5 +43,6 @@
],
'result' => true
]
],
]

];
Expand Up @@ -182,4 +182,78 @@
],
]
],
'testSucceedTrailingSlashRequestShouldReturnBody' => [
'config' => [
'url' => 'https://example.com/test',
'api_url' => 'https://api.example.com',
'email' => 'example@email.com',
'key' => 'key',
'response' => [
'code' => 200,
'message' => 'message',
'body' => 'body',
],
'errors_count' => 1,
'request_uri' => 'https://api.example.comrucss-job',
'args' => [
'body' => [
'wpr_email' => 'example@email.com',
'wpr_key' => 'key',
'url' => 'https://example.com/test/',
'config' => [
'aa' => 'aa'
],
],
'timeout' => 5,
'method' => 'POST'
],
'options' => [
'aa' => 'aa'
],
'is_succeed' => true,
'code' => 200,
'message' => 'message',
'body' => json_encode([
'code' => 200,
'message' => 'message',
'contents' => [
'jobId' => 10,
'queueName' => 'EU',
],
]),
'to_merge' => [
'code' => 200,
'message' => 'message',
'contents' => [
'jobId' => 10,
'queueName' => 'EU',
],
],
'merged' => [
'code' => 200,
'message' => 'message',
'contents' => [
'jobId' => 10,
'queueName' => 'EU',
],
],
'default' => [
'code' => 400,
'message' => 'Bad json',
'contents' => [
'jobId' => 0,
'queueName' => '',
],
],
'is_unauthorized' => false,
],
'expected' => [
'code' => 200,
'message' => 'message',
'contents' => [
'jobId' => 10,
'queueName' => 'EU',
],
]
],
];

0 comments on commit 0357eea

Please sign in to comment.