-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some issues when upgrade pact-php from version 8 to 10 #703
Comments
No, you don't need to create mock server manually. It will be created automatically by passing You can ignore the mock server. It will be started automatically with random port, and will be destroyed automatically after the test.
This is the code under test. It is responsible for sending the API request. It has the ability to change the API's base URI to that of the mock server. I believe the example code is not changed since version 8: https://github.com/pact-foundation/pact-php/tree/8.1.0?tab=readme-ov-file#make-the-request
I guess # composer.json
{
"config": {
"allow-plugins": {
"pact-foundation/composer-downloads-plugin": true
}
},
}
|
@tienvx Thanks for your quick response I saw all the amphp packages, including the http server, have been removed. But there is a new pact-stub-server, is it an alternate for the mock server? I already added the setting to my composer.json, and these are the packages that have been installed, but I don't see
|
Yes,
No, they are not the same. Mock server is for contract testing, while stub server is for helping frontend (web/mobile) development. Here is a note from stub server home page:
Thanks for including the screenshot. It is supposed to pick up the
If the output is |
@tienvx Indeed, I have the so file now. thanks a lot. |
This issue is quite similar with #692 TLDR: Install on Ubuntu but run tests on Alpine, and vice versa. |
@tienvx Another problem is that I can't find the log file.
Any idea? thanks |
I almost make all the APIs work, except those APIs with content-type Here is how I use Guzzle to call the API
This is how I build the request
And this is the
Just wondering if you happen to know why, thanks |
Version 10.0 doesn't support putting logs into a file. It's supported in version 10.1, but it's currently on beta. Here is the log usage in version 10.1: https://github.com/pact-foundation/pact-php/pull/704/files
I suggest you set the log level to I guess the problem is: I'm implementing matchers support for |
To make this issue focus, I suggest you ask questions on Slack (pact-php channel). I will answer when possible. |
use App\Service\HttpClientService;
outside the package, what is it?Thanks
The text was updated successfully, but these errors were encountered: