This repository was archived by the owner on Feb 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[ ![ Build Status] ( https://travis-ci.org/usox/hackmock.svg?branch=master )] ( https://travis-ci.org/usox/hackmock )
22
3- # HackMock - in development...
3+ # HackMock
44
55Creating mock objects for hacklang - yes, seriously.
66
7- It's strongly recommended not to use this in any sort of production environment.
7+ ## Note
8+
9+ Due to the use of ` eval ` , hackmock may stop working in future hhvm versions.
810
911## What works?
1012- Strict mode
11- - Creating mocks of interfaces
13+ - Creating mocks of interfaces and concrete classes
1214- Defining basic method expectations (parameter validation, return value definition)
1315
1416## What does not work?
15- - Everything else.
16-
17- ## But I want to try
18- Ok.
17+ - Everything else, especially rare and/or untested cases involving generics, etc.
1918
2019``` php
2120use function Usox\HackMock\{mock, prospect};
@@ -26,7 +25,7 @@ class SomethingTest extends \Usox\HackMock\HackMock {
2625 $my_fine_class = mock(SomeInterface::class);
2726
2827 prospect($my_fine_class, 'someMethodName')
29- ->times(1 )
28+ ->once( )
3029 ->andReturn('some-fine-value');
3130
3231 prospect($my_fine_class, 'someOtherMethodName')
You can’t perform that action at this time.
0 commit comments