定制 suin/php-expose 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

suin/php-expose

最新稳定版本:1.0

Composer 安装命令:

composer require suin/php-expose

包简介

Makes non-public properties and methods be testable to help your unit tests with PHPUnit.

README 文档

README

Expose makes non-public properties and methods be testable to help your unit tests with PHPUnit.

The build status of the current master branch is tracked by Travis CI: Build Status

<?php
use \Expose\Expose as e;

class Object
{
	private $_secret;
	protected $_protected;

	private function _hello($world = 'World')
	{
		return sprintf('Hello, %s', $world);
	}
}

$object = new Object();

// Expose non-public properties
e::expose($object)
	->attr('_secret', 'foo')
	->attr('_protected', 'bar');

// Call non-public method
$result = e::expose($object)->call('_hello', 'Suin');

Requirements

  • PHP 5.3 or later

Installation

Just git-clone or inntall via composer.

composer.json:

{
	"require": {
		"suin/php-expose": ">=1.0"
	}
}

Inclue vendor/autoload.php in your bootstrap.php of PHPUnit to load Expose components:

require_once 'vendor/autoload.php';

License

MIT License

统计信息

  • 总下载量: 7.17k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 13
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-09-16