0

When testing an API endpoint is there a way to make the HTTP request to a test server started by the testing framework(PHPUnit) maybe building a specific database just for testing?

What I find online is a bit strange. It implies to make a request to an already running server using phalcon/incubator

Here is what I found online: https://forum.phalconphp.com/discussion/1475/-solved-unittest-on-my-api-project

I am curious if this approach of using an already running server is common in PHP.

If possible can you point me to some repositories with examples of php phalcon tests.

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

I can recommend using Travis CI to deploy a clean instance and installing all dependencies (Phalcon, MySQL, Redis etc) and seeding the newly created database. For testing api endpoints we rely on the CodeCeption Framework for api tests, json-schema validation etc.

aat2703
  • 67
  • 1
  • 9