RestControl

Modern and powerful framework for testing REST services


# Elegant and expressive

RestControl is modern and powerful framework for testing REST services. RestControl provides set of tools for describing HTTP requests and responses in expressive and elegant way.

        
 /**
  * @test(
  *     title="Example test",
  *     description="Example test description",
  *     tags="find user"
  * )
  */
 public function exampleFindUser()
 {
    return $this->send()
                ->get('https://jsonplaceholder.typicode.com/users/1')
                ->expectedResponse()
                ->json()
                ->jsonPath('$.address.street', $this->endsWith('Light'));
 }
        
    

# Quick start

The best way for quick start is to use RestControl standalone application. You can find it here rest-control/standalone-testing-application. If you want to save yourself the hassle of installing dependencies required for this project on your local machine, you can use Docker containers as an alternative. Note that you will need Docker and Docker Compose in version >= 2.1.

To build and start RestControl standalone application, run following commands:

user@user:~/projects/standalone-testing-application$ make build
user@user:~/projects/standalone-testing-application$ make start

Now, you can use Docker machine and run example tests.

user@user:~/projects/standalone-testing-application$ docker exec -it restcontrol_cli_1 bash
user@machineid:/app# php vendor/bin/rest-control run