PHPackages                             larapkg/testing - 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. larapkg/testing

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

larapkg/testing
===============

Testing and code standards module

021PHPCI failing

Since Oct 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/LaraPKG/testing)[ Packagist](https://packagist.org/packages/larapkg/testing)[ RSS](/packages/larapkg-testing/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

LaraPkg Testing
===============

[](#larapkg-testing)

This module is set up to enable packages access to unified coding standards and testing tools for package development, for example traits used for package unit tests, the ability to mock things.

It also allows CI/CD pipelines to run against the standards set out within this package as failures will produce error exit codes stopping your pipeline.

Installing
----------

[](#installing)

To install this package simply `composer require larapkg/testing`

Usage
-----

[](#usage)

In your package `composer.json` add the following at the end of the file as the testing binary will be copied to your vendor/bin directory on installation.

```
"scripts": [
  "testing": "./vendor/bin/testing"
]
```

You will now be able to run the command `composer testing` in your package root to run the testing tool.

Using the above command will run a console instance with the available commands for checking standards, fixing coding standards issues and running static analysis.

If doing work to submit to the LaraPKG Organisation then require this module is it does not already exist in the repo you are working on as a PR will be unable to merge without it.

If not using this package for working with a LaraPKG package then it is advisable to fork this repo and add your unit traits' etcetera, to your own version as you develop them.

Available Commands
------------------

[](#available-commands)

The package provides several commands

Code Standards:

- cs:all
- cs:code\_sniffer
- cs:psalm
- cs:mess\_detector
- cs:loc

Fix Tools:

- fix:all
- fix:code\_beautifier
- fix:psalm

Unit Testing:

- test

Utilities:

- test:copy

### CS:ALL

[](#csall)

The `composer testing cs:all` command will run all above code standards commands.

### CS:CODE\_SNIFFER

[](#cscode_sniffer)

The `composer testing cs:code_sniffer` command will run the code sniffer standards checks separately, at LaraPKG we use WebImpress Coding Standards with minor alterations which can be found in the ruleset.xml file at the base of this repository. [Web Impress](https://github.com/webimpress/coding-standard) - [Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)

When the command is run, if a rule is found to be violated it will be displayed below the infringed rule.

### CS:PSALM

[](#cspsalm)

When the `composer testing cs:psalm` command is run, static analysis will be tested across the package. We use the highest level of alert in an attempt to get the highest quality code possible into the repositories, free from bugs. [Psalm](https://psalm.dev/)

### CS:MESS\_DETECTOR

[](#csmess_detector)

Mess Detector `composer testing cs:mess_detector` is a tool for weeding out bad code and helps massively to improve practice and to reduce unforeseen design flaws whilst encouraging best practice. We use several rule sets for mess detector:

- codesize
- controversial
- design
- cleancode

We believe this makes a good set of rules for producing solid code.

Note if using this tool within a large code base, you may find certain practices too large to handle, it is advisable to cure everything you can first and then create a baseline file to ignore the violations that you want to remain present. Please read mess detectors website for advice on this. [Mess Detector](https://phpmd.org/)

### CS:LOC

[](#csloc)

`composer testing cs:loc` PhpLoc is a tool for quickly measuring the size and analyzing the structure of a PHP project.

It will provide you with an analysis of the complexity of your codebase. [PhpLoc](https://github.com/sebastianbergmann/phploc)

### FIX::ALL

[](#fixall)

The `composer testing fix:all` command will run all the fixing tools, be careful!

### FIX:CODE\_BEAUTIFIER

[](#fixcode_beautifier)

The `composer testing fix:code_beautifier` command will run code sniffers companion fixer tool using the same set of standards that code sniffer uses to analyse you code base so should be quite safe to run. [Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer)

### FIX:PSALTER

[](#fixpsalter)

The `composer testing fix:psalter` command runs Psalms companion fixing tool, whilst this is relatively safe to do as we have limited what it fixes, it "could" produce more work for you so if you do use it, do so before running the `cs` command then you won't know if its produced more work for you. [Psalm](https://psalm.dev/)

### TEST

[](#test)

The `composer testing test` command will fire uup phpunit to run your unit tests, as this package is for working with packages for Lumen or Laravel we also pull in `orchestra/testbench`[Testbench](https://packages.tools/testbench/getting-started/introduction.html#installation)

### TEST:COPY

[](#testcopy)

The `composer testing test:copy` command is a utility command that you will not need to run manually. When the `test` command is run, if you have no phpunit.xml in the base of your code base, this command will be run to add it using our basic template.

And that completes the roundup of the commands within the package, you should see that this will help you to achieve a high standard of practice, quality and reliability within your code bases. Good Luck!

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e2afdd94a6f21a4ec2c5df569b80c1d47d6f5d0428f866f55c4bc117856b58b?d=identicon)[Ron Appleton](/maintainers/Ron%20Appleton)

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/larapkg-testing/health.svg)

```
[![Health](https://phpackages.com/badges/larapkg-testing/health.svg)](https://phpackages.com/packages/larapkg-testing)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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