-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix Thinkphp LoadMiddleware middleware.php file more Load #68
Conversation
When you trace the code, you see that each request is loaded into the middleware.php file.So I changed it to only load once. |
relevance Issue think文件报错 #38 |
@yangguangwuwu Could you check it ?? |
ok, hold on. |
I need help , check works fine in my local area , but in online check always stop on "it delete COOKIES " and "it check $_FILES with composer.json with dataset file_composer " , see other issue #59 vscode ➜ /workspaces/php/AdapterMan (fix-thinkphp-load-middleware) $ vendor/bin/pest --colors=always
PASS Tests\Feature\ConvertExtVarToUnderscoreTest
✓ it converts GET Query var name to underscore with ('a b', 'a_b') 0.02s
✓ it converts GET Query var name to underscore with ('a.b', 'a_b')
✓ it converts GET Query var name to underscore with ('a[b', 'a_b')
✓ it converts GET Query var name to underscore with ('a_b', 'a_b')
✓ it converts GET Query var name to underscore with ('a]b', 'a]b')
✓ it converts GET Query var name to underscore with ('a-b', 'a-b')
✓ it converts GET Query var name to underscore with ('a/b', 'a/b')
✓ it converts GET Query var name to underscore with ('a\b', 'a\b')
✓ it converts GET Query var name to underscore with ('a,b', 'a,b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a b', 'a_b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a.b', 'a_b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a[b', 'a_b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a_b', 'a_b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a]b', 'a]b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a-b', 'a-b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a/b', 'a/b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a\b', 'a\b')
✓ it convert POST "application/x-www-form-urlencoded" var name to underscore with ('a,b', 'a,b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a b', 'a_b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a.b', 'a_b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a[b', 'a_b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a_b', 'a_b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a]b', 'a]b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a-b', 'a-b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a/b', 'a/b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a\b', 'a\b')
✓ it convert POST "multipart/form-data" var name to underscore with ('a,b', 'a,b')
PASS Tests\Feature\CookiesTest
✓ it set COOKIES 0.01s
✓ it delete COOKIES
PASS Tests\Feature\GetTest
✓ it tests GET
✓ it tests GET Query string with dataset "empty"
✓ it tests GET Query string with dataset "one var"
✓ it tests GET Query string with dataset "two vars"
✓ it tests GET Query string with dataset "indexed-array"
✓ it tests GET Query string with dataset "associative-array"
✓ it tests GET Query string with dataset "all mixed"
✓ it tests GET Query string with dataset "10k body"
✓ it tests GET Query string with complex array with ([['Bob Smith', '47', 'M', …], ['golf', 'opera', 'poker', …], [['12', 'M'], ['8', 'F']], …])
PASS Tests\Feature\HttpMethodsTest
✓ it get HTTP method with ('GET')
✓ it get HTTP method with ('POST')
✓ it get HTTP method with ('PUT')
✓ it get HTTP method with ('DELETE')
✓ it get HTTP method with ('OPTIONS')
✓ it get HTTP method with ('PATCH')
✓ it get HTTP HEAD method and not return body
✓ it get HTTP BAD method return 400
✓ it get HTTP lowercase method return 400 with ('get')
✓ it get HTTP lowercase method return 400 with ('Get')
✓ it get HTTP lowercase method return 400 with ('post')
✓ it get HTTP lowercase method return 400 with ('Post')
✓ it get HTTP lowercase method return 400 with ('put')
✓ it get HTTP lowercase method return 400 with ('Put')
✓ it get HTTP lowercase method return 400 with ('delete')
✓ it get HTTP lowercase method return 400 with ('Delete')
✓ it get HTTP lowercase method return 400 with ('patch')
✓ it get HTTP lowercase method return 400 with ('Patch')
✓ it get HTTP lowercase method return 400 with ('head')
✓ it get HTTP lowercase method return 400 with ('Head')
✓ it get HTTP lowercase method return 400 with ('options')
✓ it get HTTP lowercase method return 400 with ('Options')
PASS Tests\Feature\IpPortTest
✓ it get client IP 0.01s
✓ it get server IP
PASS Tests\Feature\PostTest
✓ it get POST "application/x-www-form-urlencoded" with dataset "empty"
✓ it get POST "application/x-www-form-urlencoded" with dataset "one var"
✓ it get POST "application/x-www-form-urlencoded" with dataset "two vars"
✓ it get POST "application/x-www-form-urlencoded" with dataset "indexed-array"
✓ it get POST "application/x-www-form-urlencoded" with dataset "associative-array"
✓ it get POST "application/x-www-form-urlencoded" with dataset "all mixed"
✓ it get POST "application/x-www-form-urlencoded" with dataset "10k body"
✓ it get POST "application/json" with dataset "empty"
✓ it get POST "application/json" with dataset "one var"
✓ it get POST "application/json" with dataset "two vars"
✓ it get POST "application/json" with dataset "indexed-array"
✓ it get POST "application/json" with dataset "associative-array"
✓ it get POST "application/json" with dataset "all mixed"
✓ it get POST "application/json" with dataset "10k body"
✓ it get POST "multipart/form-data" with dataset "empty"
✓ it get POST "multipart/form-data" with dataset "one var"
✓ it get POST "multipart/form-data" with dataset "two vars"
✓ it get POST "multipart/form-data" with dataset "indexed-array"
✓ it get POST "multipart/form-data" with dataset "associative-array"
✓ it get POST "multipart/form-data" with dataset "all mixed"
✓ it get POST "multipart/form-data" with dataset "10k body"
PASS Tests\Feature\RequestHeadersTest
✓ it get Request Headers with dataset "empty" 0.01s
✓ it get Request Headers with dataset "one var"
✓ it get Request Headers with dataset "two vars"
✓ it get Request Headers with dataset "numerically index"
✓ it get Request Headers with dataset "referer"
✓ it get Request Headers with dataset "key start with X"
✓ it get headers with ('Host', '127.0.0.1:8080')
✓ it get headers with ('User-Agent', 'Testing/1.0')
PASS Tests\Feature\StatusTest
✓ it tests 200 GET
✓ it tests 404 GET
PASS Tests\Feature\UploadTest
✓ it check $_FILES with composer.json with dataset "file_composer"
✓ it get POST Multipart with files with dataset "empty"
✓ it get POST Multipart with files with dataset "one var"
✓ it get POST Multipart with files with dataset "two vars"
✓ it get POST Multipart with files with dataset "indexed-array"
✓ it get POST Multipart with files with dataset "associative-array"
✓ it get POST Multipart with files with dataset "all mixed"
✓ it get POST Multipart with files with dataset "10k body"
TODO Tests\Unit\ExampleTest - 1 todo
↓ example
Tests: 1 todo, 101 passed (492 assertions)
Duration: 1.23s
INFO Adapterman/0.6.1 (Workerman/4.1.15) OK
Workerman[/workspaces/php/AdapterMan/tests/AdaptermanServer.php] start in DEBUG mode
-------------------------------------------- WORKERMAN --------------------------------------------
Workerman version:4.1.15 PHP version:8.2.14 Event-Loop:\Workerman\Events\Select
--------------------------------------------- WORKERS ---------------------------------------------
proto user worker listen processes status
tcp vscode Adapterman Tests http://0.0.0.0:8080 1 [OK]
---------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.
vscode ➜ /workspaces/php/AdapterMan (fix-thinkphp-load-middleware) $ |
php version: |
Some of my friends were having trouble using it, so I added thinkphp recipes. at commit 0bcd997 |
Hi @645418484 ThinkphpI can't test it with it. RecipeThank you for the recipe. That start automatically a server, and detect the framework in use. Tests
Perhaps you are testing Workerman, and not Adapterman, because that 2 errors occur only in Workerman. Check the output, that you are testing Adapterman: INFO Adapterman/0.6.1 (Workerman/4.1.15) OK
Workerman[/workspaces/php/AdapterMan/tests/AdaptermanServer.php] start in DEBUG mode Workerman fail the tests, because the Workerman tests are not finished yet. Not because fail. Initially I wanted to create the functional tests for both Adapterman and Workerman. https://github.com/joanhey/TestMan As any issue in one runtime, also it can exist in others runtimes, then with the time it will have enough feedback to have a solid functional test. Thanks for your comments. PD: please try to separate the topics in PRs and Issues, so it'll be easier to find it to others devs. |
Hello, @joanhey RecipeI will delete the newly added Recipe file and then I will provide a separate issue to deal with it TestsI have taken a look at the pest unit test code and perhaps we should test the standard functionality of the http protocol to satisfy most scenarios with less effort. That's just a little thought hahaha otherFor this pr, I will also create an issue to associate with Thank you very much |
Added in PR |
No description provided.