PHPackages                             tests-always-included/health-check - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tests-always-included/health-check

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tests-always-included/health-check
==================================

A generic HealthChecker component for use with Symfony2 and alike projects.

v0.0.2(12y ago)220[1 issues](https://github.com/tests-always-included/HealthCheckComponent/issues)MITPHP

Since Aug 16Pushed 11y ago6 watchersCompare

[ Source](https://github.com/tests-always-included/HealthCheckComponent)[ Packagist](https://packagist.org/packages/tests-always-included/health-check)[ Docs](https://github.com/tests-always-included/HealthCheckComponent)[ RSS](/packages/tests-always-included-health-check/feed)WikiDiscussions master Synced today

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

HealthCheckComponent
====================

[](#healthcheckcomponent)

A generic HealthChecker component for use with Symfony2 and alike projects.

[![Build Status](https://camo.githubusercontent.com/35a1b5a43dd83e3cb2feac3ac66e56c369a3fcd76c505cae8da92ebba2d54247/68747470733a2f2f7472617669732d63692e6f72672f74657374732d616c776179732d696e636c756465642f4865616c7468436865636b436f6d706f6e656e742e737667)](https://travis-ci.org/tests-always-included/HealthCheckComponent)

Features
--------

[](#features)

- Organizable tests in TestSuites and TestGroups.
- Customizable reporting.
- Customizable method of determining final success/health.
- The ability to intercept errors (useful for shoddy SOAP clients).
- A stateless service for executing test(s).

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

[](#installation)

### As a standalone repository

[](#as-a-standalone-repository)

This method is generally used for development.

```
git clone https://github.com/tests-always-included/HealthCheckComponent.git HealthCheckComponent
/path/to/your/composer.phar install

```

### As a dependency

[](#as-a-dependency)

This method would include the component as part of your project. **composer.json**

```
{
    ...
    dependencies: {
        ...,
        "tests-always-included/health-check": "@dev-master"
    }
}

```

Tell composer to update your project's vendors. `/path/to/your/composer.phar install`

Testing
-------

[](#testing)

Tests are written utilizing the **PHPUnit Framework**.

```
cd /path/to/your/clone/of-this-repository
./vendor/bin/phpunit -c .

```

Usage
-----

[](#usage)

### Create some Test(s).

[](#create-some-tests)

Each test must extend the abstract definition in this library. No default implementation is provided.

**Example scenario**:

- Your project connects to a remote service.
- This remote service may require authentication.
- The health of your site depends on that authentication.

```
namespace My\Project\HealthCheck\Tests;

use TestsAlwaysIncluded\HealthCheck\Test\Test;

class MyTest extends Test
{
    public function execute()
    {
        // Example: Authentication check.
        $someService->authenticate();

        if ($someService->isAuthenticated()) {
            $this->pass('My service is authenticating as expected.');
            return;
        }

        if ($someService->timedOut()) {
            $this->fail('My service appears to be down.');
            return;
        }

        if ($someService->isNotConfigured()) {
            $this->skip('We might be running this from a lower environment.');
            return;
        }

        if ($someService->returnedGarbage()) {
            $this->error('My service is doing something I didnt expect.');
            return;
        }
    }
}

```

### Build up your TestSuite(s)

[](#build-up-your-testsuites)

```
$test = new MyTest;
$testGroup = new TestGroup('RemoteServicesAreEverywhere');
$testGroup->addTest($test);
$testSuite = new TestSuite('ThisIsProbablyABundleInMyProject');
$testSuite->addTestGroup($testGroup);

```

### Attach the TestSuite(s) to your HealthCheck

[](#attach-the-testsuites-to-your-healthcheck)

```
$healthCheck = new HealthCheck;
$healthCheck->addTestSuite($testSuite);

```

### Define the reporting you'd like (if any).

[](#define-the-reporting-youd-like-if-any)

```
// Example: A basic console dot-F reporter is included with the repo.
$reporter = new ConsoleOutputReporter();

// A second, optional argument allows you to alias the reporter.
// Otherwise, the Reporter's class name is used.
$healthCheck->registerReporter($reporter, 'consoleReporter');

```

### Execute the scenario you've created.

[](#execute-the-scenario-youve-created)

```
$runner = new HealthCheckRunner;
// You will most likely obtain an EventDispatcher from your DependencyInjection Container.
$runner->setEventDispatcher($eventDispatcher);
$runner->run($healthCheck);

```

### Determine if your system is Healthy.

[](#determine-if-your-system-is-healthy)

```
// You can define your own strategies, as well.
// A simple PassFailSuccessStrategy is included with the repo.
$successStrategy = new PassFailSuccessStrategy();

echo $healthCheck->passed($successStrategy) ? 'Everything is AOK!' : 'Something might be wrong.';

```

Future Consideration
--------------------

[](#future-consideration)

- Allow a test to be skipped if a dependent test fails/passes/etc.
- Provide a default command implementation for executing test(s).
- Permit multiple instances of a Reporter to be attached (may be useful for outputting a simple and a detailed report in the same format).
- Provide a default loader for assembling a HealthCheck instance from an array configuration.

###  Health Score

23

↑

LowBetter than 25% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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

4382d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/598148?v=4)[Will](/maintainers/wjaspers)[@wjaspers](https://github.com/wjaspers)

---

Top Contributors

[![wjaspers](https://avatars.githubusercontent.com/u/598148?v=4)](https://github.com/wjaspers "wjaspers (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tests-always-included-health-check/health.svg)

```
[![Health](https://phpackages.com/badges/tests-always-included-health-check/health.svg)](https://phpackages.com/packages/tests-always-included-health-check)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k257.0M27.9k](/packages/friendsofphp-php-cs-fixer)[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k886.6M9.7k](/packages/symfony-http-kernel)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k257.3M12.4k](/packages/symfony-framework-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M427](/packages/easycorp-easyadmin-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k190.0M2.6k](/packages/symfony-security-bundle)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)

PHPackages © 2026

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