// docs / why-pest

Why Pest

When testing PHP code, you have access to a range of frameworks. However, we believe that Pest is the most elegant testing framework in the world. It is designed to make the testing process enjoyable, and our goal is to make your tests simple to read and understand, with a syntax that closely resembles natural human language:

1function sum($a, $b) {
2 return $a + $b;
3}
4 
5test('sum', function () {
6 $result = sum(1, 2);
7 
8 expect($result)->toBe(3);
9});

You may expect a seamless and efficient coding experience thanks to Pest's expressive API, inspired by Ruby's RSpec and Jest. In addition, the test reporting is well-organized, practical, and informative, with clear and concise error and stack trace displays for quick debugging. With Pest, you may obtain test reporting that is unmatched in its beauty, directly from the console:

  FAILED  Tests\Feature\ExampleTest > it returns a successful response
  Expected response status code [300] but received 200.
 
 
at tests/Feature/ExampleTest.php:6
2
3 it('returns a successful response', function () {
4 $response = $this->get('/');
5
6 $response->assertStatus(300);
7 });
8
 
 
Tests:      1 failed, 1 passed (2 assertions)
Duration:   0.15s

In addition to its beautiful test reporting, Pest also offers a range of other helpful features, including:

Whether you are engaged in a small personal project or a large-scale enterprise application, Pest has you covered. So, if you want to make the testing process enjoyable and efficient, give Pest a try. We are confident that you will love it as much as we do.


You may learn how to install Pest by visiting the next section of the documentation: Installation →