php_thread_test.go 575 B

12345678910111213141516171819202122232425262728
  1. package frankenphp
  2. import (
  3. "net/http"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func TestMainRequestIsActiveRequest(t *testing.T) {
  8. mainRequest := &http.Request{}
  9. thread := phpThread{}
  10. thread.mainRequest = mainRequest
  11. assert.Equal(t, mainRequest, thread.getActiveRequest())
  12. }
  13. func TestWorkerRequestIsActiveRequest(t *testing.T) {
  14. mainRequest := &http.Request{}
  15. workerRequest := &http.Request{}
  16. thread := phpThread{}
  17. thread.mainRequest = mainRequest
  18. thread.workerRequest = workerRequest
  19. assert.Equal(t, workerRequest, thread.getActiveRequest())
  20. }