rootwork/phpunit-helpers
最新稳定版本:2.0.0
Composer 安装命令:
composer require rootwork/phpunit-helpers
包简介
PHPUnit Helpers
关键字:
README 文档
README
Helper traits for PHPUnit
"You can touch your privates and you can touch your friends' privates but you can't touch your parents' privates... unless they're protected." -Unknown
Installation
Install composer in a common location or in your project:
curl -s http://getcomposer.org/installer | php
Create the composer.json file as follows:
{
"require": {
"rootwork/phpunit-helpers": "dev-master"
}
}
Run the composer installer:
php composer.phar install
Usage
namespace Test; use Rootwork\PHPUnit\Helper\Accessor; class MyTest extends \PHPUnit_Framework_TestCase { use Accessor; public function testThings() { $sut = new MyThing(); // Set a non-public property $this->setPropertyValue($sut, 'someNonPublicProperty', 'foo'); // Get a non-public property $result = $this->getPropertyValue($sut, 'someNonPublicProperty'); // foo // Invoke a non-public method $this->invokeMethod($sut, 'someNonPublicMethod', ['foo', 'bar']); // Invoke a non-public method with arguments $this->invokeMethod($sut, 'someNonPublicMethod', ['foo', 'bar']); } }
统计信息
- 总下载量: 6.71k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-02-08