PHPackages                             phphooligans/tdd-workshop - 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. phphooligans/tdd-workshop

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

phphooligans/tdd-workshop
=========================

🏫 Package to be used with the PhpHooligans Unit-testing Workshop 🎓

v0.1.1(9y ago)020GPL-3.0+PHP

Since Oct 31Pushed 9y ago2 watchersCompare

[ Source](https://github.com/PHPHOOLIGANS/workshop-unit-testing)[ Packagist](https://packagist.org/packages/phphooligans/tdd-workshop)[ Docs](https://workshop-php-tdd.herokuapp.com)[ RSS](/packages/phphooligans-tdd-workshop/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

🏫 PhpHooligans Workshop - Unit-Testing - The Basics 🎓
=====================================================

[](#-phphooligans-workshop---unit-testing---the-basics-)

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

[](#introduction)

This workshop is a first introductory course to *isolated automated checks*(also known as unit-testing). It is geared towards explaining how to create and run automated checks on a PHP code-base with PhpUnit.

After a short theoretical introduction, participants will gain the knowledge and ability to create unit-tests, and run them on a local or remote environment (such as build/CI server).

Overview
--------

[](#overview)

The workshop is structured as follows:

### Preparation:

[](#preparation)

- Make sure PHP + Xdebug is installed and correctly configured
- Open the [PhpUnit manual](https://phpunit.de/manual/current/en/)

### Theory

[](#theory)

A brief introduction on what automated checks are and how they work

1. What is an automated check?
2. What is an automated check *not*? (i.e. exploratory)
3. How do automated checks work?
4. Various benefits
5. A word on xUnit
6. Testing old Code vs. Checking new Code

### Practice

[](#practice)

1. Installing PHPUnit
    - Globally
    - Per project
    - Using different versions (using phpunit.phar)
2. Pick a project to use for testing (or use the WordWrapper example from [`PHPHOOLIGANS/workshop-unit-testing`](https://github.com/PHPHOOLIGANS/workshop-unit-testing))
3. Basic Configuration
    - Commandline options
        - `--configuration`
    - Local configuration file (phpunit.xml) -- ``
    - Project configuration file (`phpunit.xml.dist`)
4. Where do the tests go? (Directory structure, Namespaces and Autoloading)
5. Creating an empty automated check
    - Pick (or create) a class to test
    - Creating a Test class
    - Creating an automated check
6. Running automated checks
7. Creating an actual automated check
8. Using Asserts to validate assumptions

Follow-up Intermediate workshops
--------------------------------

[](#follow-up-intermediate-workshops)

Once the basics are under control, developers might want to learn more features that PHPUnit offers. There is a workshop aimed at intermediate knowledge.

1. Configuring the IDE or text-editor. Supported options are: a. PhpStorm b. Atom c. Vim d. Sublime e. Other editor (an external tools is used)
2. Providing data to tests using DataProviders
3. Using test doubles
4. Setting up test dependencies
5. More configuration
    - Strictness
        - `forceCoversAnnotation="true"`
    - ``
        - TestDox
        - Coverage Text
        - Coverage Clover XML
    - ``
6. Code Coverage
    - Adding annotation `@coversDefaultClass` and `@covers`

Follow-up Advanced workshops
----------------------------

[](#follow-up-advanced-workshops)

There more advanced or topic-specific workshops beyond the knowledge the intermediate workshop offers:

- Acceptance Tests with Selenium and the [php-webdriver](https://github.com/facebook/php-webdriver)
- Generating Test Data with [QuickCheck](https://github.com/steos/php-quickcheck)
- Test Mutation with [Humbug](https://github.com/padraic/humbug)
- Mocking build-in or legacy functionality with [php-mock](https://github.com/php-mock/php-mock)
- Working with other Mock libraries such as [Mockery](https://github.com/padraic/mockery) or [Phony](https://github.com/eloquent/phony)
- Writing tests using PHP's native [PHPT](https://qa.php.net/write-test.php)
- Speeding up deploy with [phpunit-clever-and-smart](https://github.com/lstrojny/phpunit-clever-and-smart)

/*EOF*/

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

3575d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/195757?v=4)[Ben Peachey](/maintainers/potherca)[@Potherca](https://github.com/Potherca)

---

Top Contributors

[![Potherca](https://avatars.githubusercontent.com/u/195757?v=4)](https://github.com/Potherca "Potherca (11 commits)")

---

Tags

testingunit testingTDDpothercaworkshoptest-drivenPhpHooligans

### Embed Badge

![Health badge](/badges/phphooligans-tdd-workshop/health.svg)

```
[![Health](https://phpackages.com/badges/phphooligans-tdd-workshop/health.svg)](https://phpackages.com/packages/phphooligans-tdd-workshop)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k142.8M1.1k](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k43.6M45.6k](/packages/orchestra-testbench)[pestphp/pest

The elegant PHP Testing Framework.

11.6k77.3M24.3k](/packages/pestphp-pest)[codeception/codeception

All-in-one PHP Testing Framework

4.9k91.6M3.4k](/packages/codeception-codeception)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1739.2M597](/packages/php-mock-php-mock-phpunit)[drupal/core-dev

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

2023.2M367](/packages/drupal-core-dev)

PHPackages © 2026

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