CINXE.COM

Pest | The elegant PHP testing framework

<!DOCTYPE html> <html lang="en"> <head> <title>Pest | The elegant PHP testing framework</title> <link href="https://pestphp.com/" rel="canonical"> <meta name="twitter:site" content="@pestphp"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:creator" content="@pestphp"> <meta name="twitter:image:alt" content="Pest | The elegant PHP testing framework"> <meta charset="UTF-8"> <meta name="author" content="Nuno Maduro"> <meta name="keywords" content="PHP, Pest, Testing Framework"> <meta name="viewport" content="width=device-width, initial-scale=1.0" > <meta name="description" content="Pest is a testing framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP." > <meta property="og:type" content="website"> <meta property="og:title" content="Pest | The elegant PHP testing framework"> <meta property="og:description" content="Pest is a testing framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP."> <meta property="og:url" content="https://pestphp.com"> <meta property="og:image" content="https://pestphp.com/assets/img/og-next.jpg"> <link rel="icon" href="/www/favicon.svg" type="image/svg+xml"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap"> <script type="module" crossorigin src="/www/index.90a8198e.js"></script> <link rel="stylesheet" href="/www/index-38c4c73d.css"> </head> <body class="w-full h-screen text-white bg-gray-900"> <main id="app"> <header class="2xl:min-h-screen md:py-12 flex flex-col items-center justify-center text-center"> <div class="from-gray-200 via-black to-black bg-gradient-to-br flex items-center justify-center rounded-[0.55rem] select-none mt-16 md:mt-0" style="padding:1px"> <figure class="shadow-white flex items-center justify-center w-32 h-32 p-3 bg-black rounded-lg shadow-2xl"> <img src="/www/assets/logo.svg" alt="pestphp logo" class="ml-1"> </figure> </div> <h1 class="sr-only">PESTPHP</h1> <h2 class="lg:text-8xl md:text-6xl drop-shadow-2xl md:mt-9 mt-6 text-3xl font-bold"> The elegant PHP <br>testing framework </h2> <h3 class="lg:text-2xl md:text-xl px-6 mt-6 text-lg leading-tight"> Pest is a testing framework with a focus on simplicity, <br class="sm:block hidden">meticulously designed to bring back the joy of testing in PHP. </h3> <div class="sm:flex-row sm:space-x-6 flex flex-col items-center mt-6"> <a href="/docs/installation" class="sm:w-auto focus:outline-none w-full px-12 py-4 text-lg font-bold text-gray-900 bg-white border border-white rounded-lg"> Get started </a> <a href="https://github.com/pestphp/pest" target="_blank" class="sm:w-auto focus:outline-none sm:mt-0 w-full px-12 py-4 mt-3 text-lg font-bold text-white bg-transparent border border-white rounded-lg"> Source code </a> </div> <h4 class="mt-12 text-lg font-semibold text-gray-100"> Partners </h4> <ul class="lg:gap-12 drop-shadow lg:px-0 flex flex-wrap items-center justify-center gap-3 px-6 mt-6"> <li> <a href="https://brokerchooser.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/brokerchooser.svg" class="w-auto h-10" /> </a> </li> <li> <a href="https://www.coderabbit.ai/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/coderabbit.svg" class="w-auto h-10" /> </a> </li> <li> <a href="https://laracasts.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/laracasts.svg" class="w-auto h-8" /> </a> </li> <li class="md:hidden sm:block hidden w-full h-0"></li> <li> <a href="https://forge.laravel.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/forge.svg" class="w-auto h-8" /> </a> </li> </ul> <ul class="drop-shadow md:gap-6 lg:px-0 flex flex-wrap items-center justify-center gap-3 px-6 mt-6"> <li> <a href="https://akaunting.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/akaunting.svg" class="w-auto h-5" /> </a> </li> <li> <a href="https://codecourse.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/codecourse.svg" class="w-auto h-5" /> </a> </li> <li> <a href="https://www.docuwriter.ai/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/docuwriter-ai.svg" class="w-auto h-10" /> </a> </li> <li> <a href="https://localazy.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/localazy.svg" class="w-auto h-5" /> </a> </li> <li class="md:block hidden w-full h-0 -mt-12"></li> <li class="md:-mt-7"> <a href="https://www.route4me.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/route4me.svg" class="w-auto h-5" /> </a> </li> <li class="md:-mt-7"> <a href="https://spatie.be/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/spatie.svg" class="w-auto h-8" /> </a> </li> <li class="md:-mt-7"> <a href="https://worksome.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/worksome.svg" class="w-auto h-5" /> </a> </li> <li class="md:-mt-7"> <a href="https://zapiet.com/?ref=pestphp" target="_blank" rel="noopener" class="table"> <img src="/www/assets/sponsors/zapiet.svg" class="w-auto h-5" /> </a> </li> </ul> <a href="https://github.com/sponsors/nunomaduro" class="table px-4 py-1.5 text-xs font-semibold text-black bg-white shadow-sm rounded mt-6"> Place your logo here </a> </header> <section class="sm:py-24 md:w-full sm:w-2/3 container max-w-5xl py-12 text-center"> <h4 class="md:text-3xl text-2xl font-bold text-center">What makes Pest special…</h4> <ul class="md:flex md:mt-12 md:space-3 md:px-0 px-6 mt-6"> <li class="md:w-1/2"> <div class="border-gray-700/50 md:w-40 md:h-40 flex items-center justify-center w-32 h-32 p-6 mx-auto border rounded-full"> <div class="from-gray-500 to-black bg-gradient-to-br md:w-32 md:h-32 container flex items-center justify-center w-24 h-24 max-w-3xl rotate-45 rounded-full select-none" style="padding:1px"> <figure class="md:w-32 md:h-32 flex items-center justify-center w-24 h-24 bg-black rounded-full"> <svg viewBox="0 0 24 24" fill="none" class="stroke-pink w-12 h-12 -rotate-45"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5" /> </svg> </figure> </div> </div> <h4 class="lg:text-2xl mt-6 text-xl font-bold"> All-in-one Framework </h4> <p class="lg:text-lg mt-3 leading-relaxed text-gray-400"> Stunning error messages ∙ <a class="underline" href="https://pestphp.com/docs/stress-testing">Stress Testing</a> ∙ Beautiful <a class="underline" href="https://pestphp.com/docs/installation">documentation</a> ∙ Colorful console output ∙ API inspired by Ruby's Rspec and Jest ∙ <a class="underline" href="https://pestphp.com/docs/mutation-testing">Mutation Testing</a> ∙ <a class="underline" href="https://pestphp.com/docs/optimizing-tests">--profile</a> for performance analysis ∙ Built-in <a class="underline" href="https://pestphp.com/docs/test-coverage">--coverage</a> reports ∙ Native <a class="underline" href="https://pestphp.com/docs/optimizing-tests">--parallel</a> support ∙ Interactive <a class="underline" href="https://pestphp.com/docs/plugins#watch">--watch</a> mode. </p> </li> <li class="md:w-1/2 md:mt-0 mt-12"> <div class="border-gray-700/50 md:w-40 md:h-40 flex items-center justify-center w-32 h-32 p-6 mx-auto border rounded-full"> <div class="from-gray-500 to-black bg-gradient-to-br md:w-32 md:h-32 container flex items-center justify-center w-24 h-24 max-w-3xl rotate-45 rounded-full select-none" style="padding:1px"> <figure class="md:w-32 md:h-32 flex items-center justify-center w-24 h-24 bg-black rounded-full"> <svg viewBox="0 0 24 24" fill="none" class="stroke-green w-12 h-12 -rotate-45"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z" /> </svg> </figure> </div> </div> <h4 class="lg:text-2xl mt-6 text-xl font-bold"> Productive Testing </h4> <p class="lg:text-lg mt-3 leading-relaxed text-gray-400"> Repeat tests with different data with <a class="underline" href="https://pestphp.com/docs/datasets">datasets</a> ∙ <a class="underline" href="https://pestphp.com/docs/migrating-from-phpunit-guide">--drift</a> your PHPUnit test suite in seconds ∙ Dozens of <a class="underline" href="https://github.com/pestphp/awesome-pest">community-developed plugins</a> ∙ Built-in <a class="underline" href="https://pestphp.com/docs/type-coverage">--type-coverage</a> ∙ Mocking with <a class="underline" href="https://pestphp.com/docs/mocking">Mockery</a> ∙ <a class="underline" href="https://pestphp.com/docs/arch-testing">Architectural Testing</a> ∙ <a class="underline" href="https://pestphp.com/docs/snapshot-testing">Snapshot Testing</a> ∙ <a class="underline" href="https://pestphp.com/docs/team-management">Team Management</a> ∙ <a class="underline" href="https://pestphp.com/docs/skipping-tests">--todos</a>, <a class="underline" href="https://pestphp.com/docs/filtering-tests">--retry</a>, and much more. </li> </ul> <p class="md:text-2xl mt-16 text-xl font-bold text-center"> Syntax you can fall in love with. </p> <div class="md:px-0 px-6"> <div class="from-gray-700 via-black to-black bg-gradient-to-bl flex items-center justify-center mb-6 rounded-[0.55rem] select-none mt-6 container max-w-3xl" style="padding:1px"> <pre class="md:pb-9 md:px-12 md:pt-8 w-full px-6 pt-5 pb-6 overflow-x-auto leading-8 text-left bg-black rounded-lg"><span class="text-gray-400">&lt;?php</span> <span class="text-pink">it</span>(<span class="text-green">'has a welcome page'</span>, <span class="text-cyan">function</span> () { $response = <span class="text-pink">$this</span><span class="text-gray-400">-></span><span class="text-cyan">get</span>(<span class="text-green">'/'</span>); <span class="text-cyan">expect</span>($response<span class="text-gray-400">-></span><span class="text-cyan">status</span>())<span class="text-gray-400">-></span><span class="text-cyan">toBe</span>(<span class="text-pink">200</span>); });</div> </div> </section> <section class="md:py-12 md:px-0 md:space-y-24 container max-w-4xl px-6 py-6 space-y-12 text-center"> <h4 class="md:text-3xl text-2xl font-bold text-center">What they say…</h4> <blockquote class="sm:text-3xl md:text-6xl text-2xl font-semibold text-center"> <p>“Pest is minimal, <br><b class="text-pink">distraction-free</b>, and <br>a joy to use.”</p> <footer class="md:mt-9 md:text-lg mt-6 text-base"> <b class="inline-flex items-center"><span>Taylor Otwell</span> <svg viewBox="0 0 24 24" class="fill-white w-4 h-4 ml-1"><path d="M23.334 11.96c-.713-.726-.872-1.829-.393-2.727.342-.64.366-1.401.064-2.062-.301-.66-.893-1.142-1.601-1.302-.991-.225-1.722-1.067-1.803-2.081-.059-.723-.451-1.378-1.062-1.77-.609-.393-1.367-.478-2.05-.229-.956.347-2.026.032-2.642-.776-.44-.576-1.124-.915-1.85-.915-.725 0-1.409.339-1.849.915-.613.809-1.683 1.124-2.639.777-.682-.248-1.44-.163-2.05.229-.61.392-1.003 1.047-1.061 1.77-.082 1.014-.812 1.857-1.803 2.081-.708.16-1.3.642-1.601 1.302s-.277 1.422.065 2.061c.479.897.32 2.001-.392 2.727-.509.517-.747 1.242-.644 1.96s.536 1.347 1.17 1.7c.888.495 1.352 1.51 1.144 2.505-.147.71.044 1.448.519 1.996.476.549 1.18.844 1.902.798 1.016-.063 1.953.54 2.317 1.489.259.678.82 1.195 1.517 1.399.695.204 1.447.072 2.031-.357.819-.603 1.936-.603 2.754 0 .584.43 1.336.562 2.031.357.697-.204 1.258-.722 1.518-1.399.363-.949 1.301-1.553 2.316-1.489.724.046 1.427-.249 1.902-.798.475-.548.667-1.286.519-1.996-.207-.995.256-2.01 1.145-2.505.633-.354 1.065-.982 1.169-1.7s-.135-1.443-.643-1.96zm-12.584 5.43l-4.5-4.364 1.857-1.857 2.643 2.506 5.643-5.784 1.857 1.857-7.5 7.642z"/></svg></b> &middot; <span class="text-pink">Creator of <a href="https://laravel.com?ref=pestphp" target="_blank" class="hover:underline">Laravel</a></span> </footer> </blockquote> <blockquote class="sm:text-2xl md:text-4xl text-xl font-semibold text-center"> <p>“It took me a year to finally give Pest <br>a try… and ten minutes to make the switch. <br><b class="md:text-6xl text-green">Pest is the way.</b><span class="md:text-6xl">”</span></p> <footer class="md:text-lg mt-6 text-base"> <b class="inline-flex items-center"><span>Jeffrey Way</span></b> &middot; <span class="text-green"><a href="https://laracasts.com?ref=pestphp" target="_blank" class="hover:underline">Laracasts</a> Owner</span> </footer> </blockquote> <blockquote class="sm:text-3xl md:text-5xl text-2xl font-semibold text-center"> <p>“I wouldn't be surprised <br>if Pest becomes the <br><b class="text-cyan">default test runner in PHP</b> <br>in the near future.”</p> <footer class="md:text-lg mt-6 text-base"> Freek Van der Herten &middot; <span class="text-cyan">Developer at <a href="https://spatie.be?ref=pestphp" target="_blank" class="hover:underline">Spatie</a></span> </footer> </blockquote> <blockquote class="md:text-4xl sm:text-3xl text-2xl font-semibold text-center"> <p>“Testing becomes an <br><b class="text-pink">addiction</b> in every project.”</p> <footer class="md:text-lg md:mt-6 mt-3 text-base"> Caneco &middot; <span class="text-pink">Full-Stack Developer at <a href="https://medicare.pt?ref=pestphp" target="_blank" class="hover:underline">Medicare</a></span> </footer> </blockquote> </section> <section class="md:pt-12 md:px-0 container max-w-3xl px-6"> <h4 class="md:text-5xl text-3xl font-bold text-center">FAQs</h4> <div class="from-gray-700 via-black to-black bg-gradient-to-bl flex items-center justify-center rounded-[0.55rem] select-none container max-w-3xl mt-12" style="padding:1px"> <ul class="md:p-12 md:text-left p-6 mx-auto space-y-12 text-center bg-black rounded-lg"> <li> <h5 class="text-2xl font-bold">How does Pest differ from PHPUnit?</h5> <p class="mt-3 md:mt-1.5 text-gray-200"><b class="text-green">Pest is built on top of PHPUnit</b>, but it spices things up with some neat features you might dig. With Pest, you have access to a user-friendly API that is inspired by Ruby's Rspec and Jest libraries, making it easy to write elegant tests quickly. Additionally, Pest's console output is truly stunning and makes it effortless to spot any issues that arise. But the benefits don't end there - Pest also includes features such as built-in parallel testing, coverage, watch mode, architecture testing, native profiling tools, snapshot testing, and the most beautiful documentation in the world. </p> <hr class="from-transparent md:from-white/50 via-white/25 md:via-transparent to-transparent bg-gradient-to-r h-[2px] rounded border-0 mt-6"> </li> <li> <h5 class="text-2xl font-bold">Do I need to rewrite all my PHPUnit tests for Pest?</h5> <p class="mt-3 md:mt-1.5 text-gray-200"><b class="text-green">No need to rewrite your PHPUnit tests for Pest.</b> Pest is designed to be progressive. You can start using Pest's features immediately after installation. However, if you want to migrate to Pest's intuitive API, community-developed migration tools are available that can do the job in as little as 3 seconds.</p> <hr class="from-transparent md:from-white/50 via-white/25 md:via-transparent to-transparent bg-gradient-to-r h-[2px] rounded border-0 mt-6"> </li> <li> <h5 class="text-2xl font-bold">Is everything on Pest free?</h5> <p class="mt-1.5 text-gray-200"><b class="text-green">Yes</b>, Pest is an open-source testing framework, and all of its features and functionalities are available for free. Pest is released under the <a href="https://opensource.org/licenses/MIT" class="decoration-gray-600 hover:decoration-white decoration-2 underline">MIT license</a>, which means you can use it, even in commercial projects. Additionally, Pest's extensive documentation, editor integrations, and community-developed plugins are also available for free.</p> <hr class="from-transparent md:from-white/50 via-white/25 md:via-transparent to-transparent bg-gradient-to-r h-[2px] rounded border-0 mt-6"> </li> <li> <h5 class="text-2xl font-bold">Who maintains Pest?</h5> <p class="mt-3 md:mt-1.5 text-gray-200"><b class="text-green">Pest has a team of more than a dozen maintainers</b> who are committed to developing and enhancing the framework. The team is spread across different regions and countries, making it a diverse and inclusive community.</p> </li> </ul> </div> </section> <footer class="md:px-0 p-12"> <small class="text-white/75 md:text-xs block text-sm text-center">&copy; <span x-data x-text="(new Date()).getFullYear()">2023</span> Pest</small> </footer> </main> <script src="https://cdn.usefathom.com/script.js" data-site="NYURIQIN" defer></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10