PHPackages                             donetechno/approval-tests-php5.6 - 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. donetechno/approval-tests-php5.6

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

donetechno/approval-tests-php5.6
================================

Approval Testing for your legacy projects.

v1.4.1(5y ago)039Apache-2.0PHPPHP ^5.6

Since Dec 4Pushed 5y agoCompare

[ Source](https://github.com/pyxis-studio/ApprovalTests.5.6php)[ Packagist](https://packagist.org/packages/donetechno/approval-tests-php5.6)[ Docs](https://github.com/approvals/ApprovalTests.php)[ RSS](/packages/donetechno-approval-tests-php56/feed)WikiDiscussions master Synced 3w ago

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

[![Build Status](https://camo.githubusercontent.com/51cc04d4c4d050028d327da362e7a388b96f0479fa087e5c3d75ba75986f4584/68747470733a2f2f7472617669732d63692e6f72672f6d61747463616e2f617070726f76616c2d74657374732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mattcan/approval-tests)

[![License](https://camo.githubusercontent.com/a549a7a30bacba7bfceebdc207a8e86c3f2c02995a2527640dca30048fd2b64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c75652e737667)](https://opensource.org/licenses/Apache-2.0)

**Table of Contents**

- [ApprovalTests.PHP](#approvaltestsphp)
    - [What can it be used for?](#what-can-it-be-used-for)
    - [How to get it](#how-to-get-it)
    - [Video Tutorials](#video-tutorials)
    - [Podcasts](#podcasts)
    - [Examples](#examples)
    - [Approved File Artifacts](#approved-file-artifacts)
    - [More Info](#more-info)
    - [LICENSE](#license)
    - [Questions?](#questions)

ApprovalTests.PHP
=================

[](#approvaltestsphp)

Capturing Human Intelligence - ApprovalTests is an open source assertion/verification library to aid unit testing.

It is compatible with PHPUnit

What can it be used for?
------------------------

[](#what-can-it-be-used-for)

Approval Tests can be used for verifying objects that require more than a simple assert. They also come prepackaged with utilities for some common scenarios including

- HashMaps &amp; Collections
- Long Strings
- Log Files
- Xml
- Html
- Json (see [features](docs/features.md))

How to get it
-------------

[](#how-to-get-it)

It's on [Packagist](https://packagist.org/packages/approvals/approval-tests); search for 'approval-tests'. If you're using Composer, you can add it as follows:

```
composer req --dev approvals/approval-tests
```

[Video Tutorials](http://www.youtube.com/playlist?list=PLFBA98F47156EFAA9&feature=view_all)
-------------------------------------------------------------------------------------------

[](#video-tutorials)

You can watch a bunch of short videos on getting started and [using ApprovalTests](http://www.youtube.com/playlist?list=PLFBA98F47156EFAA9&feature=view_all) at YouTube. These cover approval tests in Java and .NET, but the same concepts apply.

Podcasts
--------

[](#podcasts)

If you prefer auditory learning, you might enjoy the following podcast (Note: Some of these talk about the .Net and Java side)

- [Cucumber Podcast](https://cucumber.io/blog/2017/01/26/approval-testing)
- [Hanselminutes](http://www.hanselminutes.com/360/approval-tests-with-llewellyn-falco)
- [Herding Code](http://www.developerfusion.com/media/122649/herding-code-117-llewellyn-falcon-on-approval-tests/)
- [The Watir Podcast](http://watirpodcast.com/podcast-53/)

Examples
--------

[](#examples)

ApprovalTests eats it own dogfood, so the best examples are in the source code itself.

None the less, Here's a quick look at some [Sample Code](https://github.com/approvals/ApprovalTests.php/blob/9ce5bbd043ea2720bdfe5bbdf25f23a225329485/tests/ApprovalTest.php#L8)

```
class ApprovalTest extends TestCase
{
    public function testVerifyArray()
    {
        $list = ['zero', 'one', 'two', 'three', 'four', 'five'];
        Approvals::verifyList($list);
    }
```

[snippet source](/tests/ApprovalTest.php#L8-L16)

Will Produce a File

```
[0] -> zero
[1] -> one
[2] -> two
[3] -> three
[4] -> four
[5] -> five
```

[snippet source](/tests/approvals/ApprovalTest.testVerifyArray.approved.txt#L1-L7)

Simply rename this to ApprovalTest.testVerifyArray.approved.txt and the test will now pass.

Approved File Artifacts
-----------------------

[](#approved-file-artifacts)

The `*.approved.*` files must be checked into source your source control. This can be an issue with git as it will change the line endings. The suggested fix is to add `*.approved.* binary` to your `.gitattributes`

More Info
---------

[](#more-info)

- [Website](http://approvaltests.sourceforge.net/)
- [Blog](http://blog.approvaltests.com/)
- [Getting Started Doc](https://github.com/approvals/ApprovalTests.Java/blob/master/build/resources/approval_tests/documentation/ApprovalTests%20-%20GettingStarted.md)

LICENSE
-------

[](#license)

[Apache 2.0 License](https://github.com/SignalR/SignalR/blob/master/LICENSE.md)

Questions?
----------

[](#questions)

twitter: [@LlewellynFalco](https://twitter.com/#!/llewellynfalco) or [@notthatjoshkel](https://twitter.com/notthatjoshkel) or #ApprovalTests

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~105 days

Recently: every ~180 days

Total

8

Last Release

2024d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1578527?v=4)[Francois Gauthier](/maintainers/fgauthier)[@fgauthier](https://github.com/fgauthier)

![](https://www.gravatar.com/avatar/7fb7542e0b3271fe734e02c2b08f4249b373878ad683801e11d2e5d10a36b00f?d=identicon)[LDGAUMONT](/maintainers/LDGAUMONT)

---

Top Contributors

[![joshkel](https://avatars.githubusercontent.com/u/476338?v=4)](https://github.com/joshkel "joshkel (34 commits)")[![mattcan](https://avatars.githubusercontent.com/u/621541?v=4)](https://github.com/mattcan "mattcan (27 commits)")[![francisgauthier1](https://avatars.githubusercontent.com/u/112140198?v=4)](https://github.com/francisgauthier1 "francisgauthier1 (5 commits)")[![underq](https://avatars.githubusercontent.com/u/1336062?v=4)](https://github.com/underq "underq (3 commits)")[![isidore](https://avatars.githubusercontent.com/u/10874?v=4)](https://github.com/isidore "isidore (1 commits)")[![FrancisGauthier](https://avatars.githubusercontent.com/u/1427117?v=4)](https://github.com/FrancisGauthier "FrancisGauthier (1 commits)")[![kelleyjd](https://avatars.githubusercontent.com/u/43043927?v=4)](https://github.com/kelleyjd "kelleyjd (1 commits)")

### Embed Badge

![Health badge](/badges/donetechno-approval-tests-php56/health.svg)

```
[![Health](https://phpackages.com/badges/donetechno-approval-tests-php56/health.svg)](https://phpackages.com/packages/donetechno-approval-tests-php56)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k129.9M910](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k41.3M38.7k](/packages/orchestra-testbench)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.0M321](/packages/drupal-core-dev)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

30300.1k6](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
