php mocking,Phake:PHP Mocking对象框架

Phake

68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f7068616b652f62616467652f3f76657273696f6e3d322e31bf1a8b338cc79ad44396a6e7034697ca.png68747470733a2f2f706f7365722e707567782e6f72672f7068616b652f7068616b652f762f737461626c652e706e6768747470733a2f2f706f7365722e707567782e6f72672f7068616b652f7068616b652f646f776e6c6f6164732e706e6768747470733a2f2f706f7365722e707567782e6f72672f7068616b652f7068616b652f762f756e737461626c652e706e6768747470733a2f2f706f7365722e707567782e6f72672f7068616b652f7068616b652f6c6963656e73652e706e67

Phake is a framework for PHP that aims to provide mock objects, test doubles and method stubs.

Phake was inspired by a lack of flexibility and ease of use in the current mocking frameworks combined with a recent experience with Mockito for Java.

A key conceptual difference in mocking between Phake and most of php mocking frameworks (ie: mock functionality in PHPUnit, PHPMock, and mock functionality in SimpleTest) is that Phake (like Mockito) employs a verification strategy to ensure that calls get made. That is to say, you call your code as normal and then after you have finished the code being tested you can verify whether or not expected methods were called. This is very different from the aforementioned products for php which use an expectation strategy where you lay out your expectations prior to any calls being made.

Installation - Composer

Phake can be installed using Composer.

Add Phake as a dependency.

You'll usually want this as a development dependency, so the example shows it in the require-dev section.

"require-dev": {

"phake/phake": "3.*"

}

Run Composer: php composer.phar install --dev or php composer.phar update phake/phake

Installation - Source

You can also of course install it from source by downloading it from our github repository: https://github.com/mlively/Phake

Links

There are a few links that have information on how you can utilize Phake.

If you have an article or tutorial that you would like to share, feel free to open an issue on github and I will add it to this list

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值