php-swagger-test
php-swagger-test copied to clipboard
Unable to run successful tests for the repo (PHPStorm 2020.1)
Hi,
thank you for the package! I I'm working on few fixes to support my openapi3 documentation and I noticed that I can't run successful tests (connection reset on 127.0.0.1) -- servers are started using provided run configurations.
I was able to fix it by changing 127.0.0.1
to localhost
in host ( swagger.json
and openapi.json
).
PHPStorms binds only localhost (on Mac Catalina), then tests can connect to the servers and run tests. Is it working in your environment if you change it to localhost?
Martin
Hello, thank you :)
I am using PHPStorm 2020.1 too on a Linux machine and it works both for localhost
and 127.0.0.1
. The run configuration shared I am using to test it inside the PHPStorm platform is:
I don't remember why I am not using localhost
but probably it is related to the Travis CI .
Please double check your configuration just to make sure nothing is wrong there. If is really necessary change to localhost, once you open a PR, the Travis platform will start the build and you can check if it is working fine. If is, It will be my pleasure integrate it to the code.
And remember to add the proper unit tests to the new cases you are adding :)
I did not change anything and the settings are same as you provided.
Event I can open localhost:8081 in browser or use curl localhost
but tests fails in PHP (using local MacOS PHP interpreter - 7.3).
The problem is that in Mac the 127.0.0.1 is not binding when you provide localhost in PHP configuration. The swagger uses 127.0.0.1 but PHP run uses localhost :)