PHPackages                             fetzi/phpspec-watcher - 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. fetzi/phpspec-watcher

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

fetzi/phpspec-watcher
=====================

phpspec-watcher is a cli tool for the automatic execution of phpspec tests when code changes

2.0.1(6y ago)1135.7k↓50%2[1 PRs](https://github.com/fetzi/phpspec-watcher/pulls)5MITPHPPHP ^7.2

Since Sep 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fetzi/phpspec-watcher)[ Packagist](https://packagist.org/packages/fetzi/phpspec-watcher)[ Docs](https://github.com/fetzi/phpspec-watcher)[ RSS](/packages/fetzi-phpspec-watcher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (9)Versions (9)Used By (5)

phpspec Watcher
===============

[](#phpspec-watcher)

[![Packagist](https://camo.githubusercontent.com/a2dabfe76b176923d153dc52d5505a1677e99f85c07f2259b4bbf687f0fedb77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6665747a692f706870737065632d776174636865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fetzi/phpspec-watcher)[![Github Actions](https://github.com/fetzi/phpspec-watcher/workflows/Build/badge.svg)](https://github.com/fetzi/phpspec-watcher/actions)[![StyleCI](https://camo.githubusercontent.com/24276fd69f9712ab2aa5f4d6e17966635d891e42df166dce7a11d1804309dec0/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130323835393338302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/102859380)[![SensioLabs Insight](https://camo.githubusercontent.com/3d226889fc6f6119419f22729f305f7e4490186eb92c012d9ad1822953b8cc9a/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f66653366386462612d313564612d343532372d613333332d3161333932643130363733642e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/fe3f8dba-15da-4527-a333-1a392d10673d)[![Maintainability](https://camo.githubusercontent.com/f0966d46c0208cf215b8877eab7306e7adcdbc70f6275914fa948cda5f14a7f7/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f61313665373830383932323566393737643437352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/fetzi/phpspec-watcher/maintainability)

Introduction
------------

[](#introduction)

phpspec-watcher is a tool for automating phpspec test execution when the source code of a project changes. On file save the watcher automatically triggers the phpspec test suite and informs the developer about the test results.

Installation
------------

[](#installation)

This tool can be installed globally with

```
composer global require fetzi/phpspec-watcher

```

or just for one package as dev-dependency

```
composer require fetzi/phpspec-watcher --dev

```

Usage
-----

[](#usage)

After a global installation you can invoke the watcher by calling

```
phpspec-watcher watch

```

If you have installed the watcher as a dev-dependency for one project you can find the binary within the vendor bin directory.

```
vendor/bin/phpspec-watcher watch

```

Configuration
-------------

[](#configuration)

The watcher can be configured with a configuration file `.phpspec-watcher.yml` stored in the project root directory.

The following listing shows the file structure and the option meanings:

```
fileMask: '*.php'                   # file pattern that should be watched

checkInterval: 1                    # a float value indicating the resource check interval

directories:                        # a list of directories that should be watched
    - app
    - src
    - spec

phpspec:
    binary: vendor/bin/phpspec      # path to the phpspec binary
    arguments: [format=dot]         # additional phpspec arguments

notifications:                      # flags for notfications on success and on error
    onError: true
    onSuccess: true
```

To speed up the configuration thing there is an initialization command to bootstrap the config file with default values:

```
phpspec-watcher init

```

Notifications
-------------

[](#notifications)

The watcher triggers operating system notifications after executing the test suite.

To display the notification icons on Mac you need to install another notifier because AppleScript cannot display custom icons

```
brew install terminal-notifier

```

Credits
-------

[](#credits)

The idea for creating this package was born after discovering the awesome [phpunit-watcher](https://github.com/spatie/phpunit-watcher) package by [Spatie](https://spatie.be).

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% of commits — single point of failure

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 ~135 days

Recently: every ~236 days

Total

8

Last Release

2226d ago

Major Versions

v0.2.1 → v1.0.02017-09-11

1.0.2 → 2.0.02019-12-05

PHP version history (2 changes)v1.0.0PHP ^7.0

2.0.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b155d5296b644a0e937677b500bee7983ce4a91294b616d7a690e57f5b14a3aa?d=identicon)[fetzi](/maintainers/fetzi)

---

Top Contributors

[![fetzi](https://avatars.githubusercontent.com/u/3509426?v=4)](https://github.com/fetzi "fetzi (26 commits)")[![mmswiderski](https://avatars.githubusercontent.com/u/5360488?v=4)](https://github.com/mmswiderski "mmswiderski (1 commits)")

---

Tags

php7phpspectest-watchertesting-tools

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/fetzi-phpspec-watcher/health.svg)

```
[![Health](https://phpackages.com/badges/fetzi-phpspec-watcher/health.svg)](https://phpackages.com/packages/fetzi-phpspec-watcher)
```

###  Alternatives

[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[spatie/phpunit-watcher

Automatically rerun PHPUnit tests when source code changes

8839.2M475](/packages/spatie-phpunit-watcher)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)

PHPackages © 2026

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