PHPackages                             pluf/test - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. pluf/test

ActiveLibrary[Testing &amp; Quality](/categories/testing)

pluf/test
=========

A pluf mock object and test utilities

6.0.23(4y ago)05.4k[2 issues](https://github.com/pluf/test/issues)9MITPHPCI failing

Since Oct 14Pushed 4y ago2 watchersCompare

[ Source](https://github.com/pluf/test)[ Packagist](https://packagist.org/packages/pluf/test)[ RSS](/packages/pluf-test/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (111)Used By (9)

Pluf Test
=========

[](#pluf-test)

[![Build Status](https://camo.githubusercontent.com/550d53dd9f05ac2abc82c85fd7f9c49b44097c92bec912c94e221a46d33712ed/68747470733a2f2f7472617669732d63692e636f6d2f706c75662f746573742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/pluf/test)[![codecov](https://camo.githubusercontent.com/6bcbb34d8ca78f9313a81a105698d0804f45e0615946e437d5152b21b7bfca98/68747470733a2f2f636f6465636f762e696f2f67682f706c75662f746573742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/pluf/test)[![Maintainability](https://camo.githubusercontent.com/d6ec99d76070bf1db3136fa8b1d1a2509fe9d9c18dac4e37fd937a38c9d4be0b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35313366333536626466323630363563633030392f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/pluf/test/maintainability)[![Test Coverage](https://camo.githubusercontent.com/c34366f2388cf1972b12b370e8144f0c393f75e47a0f4d03c210f8c934101428/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f35313366333536626466323630363563633030392f746573745f636f766572616765)](https://codeclimate.com/github/pluf/test/test_coverage)[![Coverage Status](https://camo.githubusercontent.com/cbf80b7492271326ea03325737d12245b38db9fb6b4b39686d74ed2258f8b0c2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f706c75662f746573742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/pluf/test?branch=master)

This tutorial assumes that you use PHP 7.3 or PHP 7.4. You will learn how to write simple unit tests as well as how to download and run PlufTest.

PlufTest is based on PHPUnit 8.

Install
-------

[](#install)

You can add Pluf/Test as a local, per-project, development-time dependency to your project using Composer:

```
➜ composer require --dev pluf/test ^6

➜ ./vendor/bin/pluftest --version
Pluf/Test 6.0.0 by pluf.ir and contributors.

```

The example shown above assumes that composer is on your $PATH.

Your composer.json should look similar to this:

```
{
    "autoload": {
        "classmap": [
            "src/"
        ]
    },
    "require-dev": {
        "pluf/test": "^9"
    }
}

```

Test Code
---------

[](#test-code)

suppose there is a code

```
src/Email.php

```

with content:

```
