All Projects → mybuilder → Phpunit Accelerator

mybuilder / Phpunit Accelerator

Licence: mit
Listeners to speed up PHPUnit tests

Labels

Projects that are alternatives of or similar to Phpunit Accelerator

Phpunit Easymock
Build PHPUnit mocks easily
Stars: ✭ 37 (-73.38%)
Mutual labels:  phpunit
Mock Webserver
Simple mock web server in PHP for unit testing.
Stars: ✭ 82 (-41.01%)
Mutual labels:  phpunit
Php Ddd Example
🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 5
Stars: ✭ 1,960 (+1310.07%)
Mutual labels:  phpunit
Lode
A universal GUI for unit testing
Stars: ✭ 51 (-63.31%)
Mutual labels:  phpunit
Designpattern
设计模式
Stars: ✭ 66 (-52.52%)
Mutual labels:  phpunit
Phpunit Arraysubset Asserts
Provides assertArraySubset for use in PHPunit
Stars: ✭ 95 (-31.65%)
Mutual labels:  phpunit
Phpqa
Docker image that provides static analysis tools for PHP
Stars: ✭ 853 (+513.67%)
Mutual labels:  phpunit
Laravel Dusk Ci
Docker Test suite for Laravel Dusk in gitlab CI
Stars: ✭ 129 (-7.19%)
Mutual labels:  phpunit
Phpumoji
PHPUnit Emoji Result Printer
Stars: ✭ 75 (-46.04%)
Mutual labels:  phpunit
Php Mock Phpunit
Mock built-in PHP functions (e.g. time() or rand()) in PHPUnit.
Stars: ✭ 121 (-12.95%)
Mutual labels:  phpunit
Magestudy
Magento 2 extension samples
Stars: ✭ 55 (-60.43%)
Mutual labels:  phpunit
Sublime Phpunit
PHPUnit support for Sublime Text
Stars: ✭ 63 (-54.68%)
Mutual labels:  phpunit
Paraunit
Run PHPUnit tests in parallel
Stars: ✭ 104 (-25.18%)
Mutual labels:  phpunit
Freelancers Market
Laravel Project to help freelance websites clients and freelancers to find each other.
Stars: ✭ 39 (-71.94%)
Mutual labels:  phpunit
Docker Compose Wordpress
An example Docker Compose setup for WordPress plugin or theme development.
Stars: ✭ 127 (-8.63%)
Mutual labels:  phpunit
Php Vcr
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
Stars: ✭ 976 (+602.16%)
Mutual labels:  phpunit
Phpunit Json Assert
PHPUnit assertions for JSON documents
Stars: ✭ 90 (-35.25%)
Mutual labels:  phpunit
Pdt
PHP Development Tools project (PDT)
Stars: ✭ 135 (-2.88%)
Mutual labels:  phpunit
Verify
BDD Assertions for PHPUnit and Codeception
Stars: ✭ 127 (-8.63%)
Mutual labels:  phpunit
Mockery
Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).
Stars: ✭ 10,048 (+7128.78%)
Mutual labels:  phpunit

PHPUnit Accelerator

Build Status

Inspired by Kris Wallsmith faster PHPUnit article, we've created a PHPUnit test listener that speeds up PHPUnit tests about 20% by freeing memory.

Installation

To install this library, run the command below and you will get the latest version

composer require mybuilder/phpunit-accelerator --dev

Usage

Just add to your phpunit.xml configuration

<phpunit>
    <listeners>
        <listener class="\MyBuilder\PhpunitAccelerator\TestListener"/>
    </listeners>
</phpunit>

Ignoring Tests

Sometimes it is necessary to ignore specific tests, where freeing their properties is undesired. For this use case, you have the ability to extend the behaviour of the listener by implementing the IgnoreTestPolicy interface.

As an example, if we hypothetically wanted to ignore all tests which include "Legacy" in their test filename, we could create a custom ignore policy as follows

<?php

use MyBuilder\PhpunitAccelerator\IgnoreTestPolicy;

class IgnoreLegacyTestPolicy implements IgnoreTestPolicy {
    public function shouldIgnore(\ReflectionObject $testReflection) {
        return strpos($testReflection->getFilename(), 'Legacy') !== false;
    }
}

And pass it to the constructor of our test listener in phpunit.xml configuration

<phpunit>
    <listeners>
        <listener class="\MyBuilder\PhpunitAccelerator\TestListener">
            <arguments>
                <object class="\IgnoreLegacyTestPolicy"/>
            </arguments>
        </listener>
    </listeners>
</phpunit>

Created by MyBuilder - Check out our blog for more insight into this and other open-source projects we release.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].