Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/driebit/booster
Make tests run faster
https://github.com/driebit/booster
Last synced: 11 days ago
JSON representation
Make tests run faster
- Host: GitHub
- URL: https://github.com/driebit/booster
- Owner: driebit
- License: mit
- Created: 2015-02-01T11:04:20.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-02T10:47:13.000Z (almost 10 years ago)
- Last Synced: 2024-11-16T17:45:36.700Z (2 months ago)
- Language: PHP
- Size: 184 KB
- Stars: 2
- Watchers: 21
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Booster
=======[![Build Status](https://travis-ci.org/driebit/booster.svg?branch=master)](https://travis-ci.org/driebit/booster)
Introduction
------------Booster is a set of tools that will make your PHP and/or Symfony tests run
faster and use less memory.Installation
------------The recommended way to install this library is through [Composer](http://getcomposer.org):
```bash
$ composer require driebit/booster
```This command requires you to have Composer installed globally, as explained
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.Usage
-----### Null properties on tear down
Nulling class properties on test tear down helps reduce memory footprint and
test runtime. For instance when using PHPUnit:```php
use Driebit\Booster\Cleaner;class MyTest extends \PHPUnit_Framework_TestCase
{
// tests here...protected function tearDown()
{
// tear down actions here...$cleaner = new Cleaner();
$cleaner->nullProperties($this);
}
}
```Or using the trait:
```php
use Driebit\Booster\Phpunit\NullOnTearDownTrait;class MyTest extends \PHPUnit_Framework_TestCase
{
use NullOnTearDownTrait;
}
```### Disable debug mode after first kernel initialization
When running functional Symfony tests, you will probably be creating the service
container many times. If debug mode is enabled, Symfony will check whether any
resources have changed during each container initialization. By disabling
debug mode, you wil be using a cached container in your tests.Use the trait from your AppKernel:
```php
use Driebit\Booster\Symfony\NoDebugTrait;class AppKernel extends Kernel
{
use NoDebugTrait;// ...
}