Skip to content

Commit

Permalink
Merge pull request #43 from maks-rafalko/feature/infection
Browse files Browse the repository at this point in the history
Add Infection Support docs
  • Loading branch information
nunomaduro committed May 12, 2021
2 parents 1e1aeba + 8f615c3 commit cf98d71
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ This option allows you to specify the directory that will be used to gather the

---

Next section: [Laravel Plugin](/docs/plugins/laravel)
Next section: [Mutation Testing](/docs/mutation-testing)
1 change: 1 addition & 0 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Datasets](/docs/datasets)
- [Coverage](/docs/coverage)
- [CLI Options](/docs/cli-options)
- [Infection Support](/docs/infection)
- ## Plugins
- [Laravel](/docs/plugins/laravel)
- [Livewire](/docs/plugins/livewire)
Expand Down
37 changes: 37 additions & 0 deletions mutation-testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Mutation Testing
description: Mutation Testing
---

# Mutation Testing with Infection

- [Overview](#overview)
- [Installation](#installation)

<a name="overview"></a>
## Overview

Mutation testing is the least common and most misunderstood type of testing. With mutation testing, the code under test is changed to create a faulty version called a mutant. You then run the mutant code through a suite of test cases, which should produce new test case failures. If no new failures appear, the test suite most likely does not exercise the code path containing the mutated code, which means the code isn't fully tested.

Performing mutation testing with Pest couldn't be easier as the most popular mutation testing framework - **[Infection](https://infection.github.io/guide/)** - includes out-of-the-box support for Pest.

<a name="installation"></a>
## Installation

> **Requirements:** [Pest 1.2+](https://pestphp.com/docs/upgrade-guide/), [Infection 0.23+](https://github.com/infection/infection/blob/master/CHANGELOG.md)
First, install Infection via the Composer package manager:

```bash
composer require infection/infection --dev
```

Then, you can run Infection directly from the command line:

```bash
vendor/bin/infection --test-framework=pest --show-mutations
```

---

Next section: [Laravel Plugin →](/docs/plugins/laravel)

0 comments on commit cf98d71

Please sign in to comment.