PHPackages                             teamntime/grumphp-phpunit-diff - 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. teamntime/grumphp-phpunit-diff

ActiveLibrary

teamntime/grumphp-phpunit-diff
==============================

A GrumPHP task that runs only the tests for the files you have changed

v1.1.4(2mo ago)011.2k↓40.9%MITPHPPHP &gt;=7.3

Since Sep 22Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/teamntime/grumphp-phpunit-diff)[ Packagist](https://packagist.org/packages/teamntime/grumphp-phpunit-diff)[ RSS](/packages/teamntime-grumphp-phpunit-diff/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (16)Versions (12)Used By (0)

GrumPHP PHPUnit Diff Task
=========================

[](#grumphp-phpunit-diff-task)

Whoa, another PHPUnit task for [GrumPHP](https://github.com/phpro/grumphp)? Well kind of.

We at Team n Time run GrumPHP both on our development machines and on our CI servers. All of our PHPUnit test suites run on CI to ensure we didn't create a regression or broke something. You could opt to run your testsuites also locally but that might not always be practical. If you get over a certain amount of assertions, this could become cumbersome.

For us, the goal is to balance not wasting developer hours vs. not wasting CI runs. It's in this balancing act that we've dreamt up having tooling that runs just tests on the difference. But what does that mean? GrumPHP handily provides you with the file names of the changed files, but there is no standard that makes locating test files of PHP classes easy.

That's where this task comes in. It allows you to define the structure of your project by creating a simple PHP function that gives you the PHP class filepath and allows you to define where it's test is located. We do this with simple str\_replace, but you might opt for any other strategy.

Install and using
-----------------

[](#install-and-using)

Install by running composer:

```
$ composer require --dev teamntime/grumphp-phpunit-diff
```

Create a PHP file with your location function that have the following structure:

```
