php / web-php

The www.php.net site
http://www.php.net
Other
816 stars 524 forks source link

Enhancement: Run end-to-end tests asserting an HTTP response status code #900

Closed localheinz closed 5 months ago

localheinz commented 6 months ago

This pull request

Also see #605.

github-actions[bot] commented 6 months ago

🚀 Commit d8fdb48b6b16413927583a2b114580a6089fc16a Deployed on https://web-php-pr-900.preview.thephp.foundation

github-actions[bot] commented 6 months ago

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

github-actions[bot] commented 6 months ago

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

github-actions[bot] commented 6 months ago

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

github-actions[bot] commented 6 months ago

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

github-actions[bot] commented 6 months ago

🚀 Deployed on https://web-php-pr-900.preview.thephp.foundation

pronskiy commented 6 months ago

@localheinz I tried adding trigger_error('Message', E_USER_ERROR); in search.php (or any other page) and the tests passed green. Is that expected behavior?

localheinz commented 6 months ago

@pronskiy

I tried adding trigger_error('Message', E_USER_ERROR); in search.php (or any other page) and the tests passed green. Is that expected behavior?

With 48a88817 and running

php -S localhost:8080 .router.php

I can see the following output in the console:

[Fri Dec 22 15:21:47 2023] [::1]:49172 Accepted
[Fri Dec 22 15:21:47 2023] PHP Fatal error:  Message in /Users/am/Sites/php/web-php/search.php on line 12
[Fri Dec 22 15:21:47 2023] [::1]:49172 [200]: GET /search.php?show=quickref&pattern= - Message in /Users/am/Sites/php/web-php/search.php on line 12
[Fri Dec 22 15:21:47 2023] [::1]:49172 Closing
[Fri Dec 22 15:21:47 2023] [::1]:49173 Accepted
[Fri Dec 22 15:21:47 2023] [::1]:49173 [200]: GET /favicon.ico
[Fri Dec 22 15:21:47 2023] [::1]:49173 Closing

With 48a88817, the tests fail on GitHub Actions, see https://github.com/php/web-php/actions/runs/7300886487/job/19896408958?pr=900.

I do not know why they pass locally and fail on GitHub Actions, but I assume it has something to do with the configuration of PHP.

pronskiy commented 5 months ago

@localheinz with the php.ini it works now 🙏

localheinz commented 5 months ago

Thank you, @pronskiy, @saundefined, and @sy-records!