driebit/booster 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

driebit/booster

最新稳定版本:0.1.2

Composer 安装命令:

composer require driebit/booster

包简介

Make your tests run faster

README 文档

README

Build Status

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:

$ composer require driebit/booster

This command requires you to have Composer installed globally, as explained in the installation chapter 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:

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:

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:

use Driebit\Booster\Symfony\NoDebugTrait;

class AppKernel extends Kernel
{
    use NoDebugTrait;

    // ...
}

统计信息

  • 总下载量: 2.5k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 20
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-01