Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: fix jobs test fail #773

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Unit/API/Management/JobsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
fwrite($import, '[{"email":"php-sdk-test-import-user-job@auth0.com","email_verified":true,"app_metadata":{"roles":["admin","super"],"plan":"premium"},"user_metadata":{"theme":"dark"}}]');

$path = stream_get_meta_data($import)['uri'];
$keyOffset = 3;
$keyOffset = 2;
Copy link
Author

@yasuaki640 yasuaki640 Sep 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is due to a change in php-http/multipart-stream-builder.

In v1.3.1, body has a Content-Length header (as shown below).

--66e64e8fe1f375.28637093
Content-Disposition: form-data; name="users”
Content-Length: 167

[{“email”: “php-sdk-test-import-user-job@auth0.com”, “email_verified”:true, “app_metadata”:{“roles”:[“admin”, “super”], “plan”: “premium “}, “user_metadata”:{“theme”: “dark”}}]
--66e64e8fe1f375.28637093
Content-Disposition: form-data; name="connection_id”
Content-Length: 16

__test_conn_id__
--66e64e8fe1f375.28637093
Content-Disposition: form-data; name="upsert”
Content-Length: 4

Content-Disposition: form-data; name=“upsert” Content-Length: 4
...

However, after v.1.3.1, the Content-Length header has been removed, so $keyOffset is misaligned and the test fails.

Therefore, I think it is better to fix the test with this fix to follow the changes in multipart-stream-builder.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And I think it is better to manage lock files by git as well.)


$this->endpoint->createImportUsers(
$path,
Expand Down