AspectMock
AspectMock copied to clipboard
The most powerful and flexible mocking framework for PHPUnit / Codeception.
Given ``` Class A { protected $x = false; public function methodA() { if($x){ return 'FOO'; } return 'BAR'; } } ``` My test is - ``` $a = new...
I enabled caching for my tests by setting the `cacheDir` config property. Now tests run much faster, but changes in files are not picked up? I expected the cache to...
Case: **Framework:** Yii2 2.0.11.2 **PHP:** 7.0.10 **AspeckMock** 2.0.1 **info** On ver. 1.0.0 works fine AspectMock wrong parsing, convert and write to temporary storage this piece of code: **original code** ```php...
For the following class ```PHP class Demo { public function aFunc() { return 'initialFunc'; } } ``` I have written the following test that mocks the class replacing `aFunc` with...
Defining a Whitelist for phpunit with the flag `processUncoveredFilesFromWhitelist="true"` can cause AspectMock to not double a thing. No telling output as well. Just doesn't work. Didn't further investigate as I...
Method declaration such as `function myMethod( ) /* {{{ */ {` cannot be mocked with Aspect Mock. On line 98 current code gets the first open bracket { amd inserts...
Static methods were introduced in PHP5, but we were allowed to make static calls to non-static methods with the '::' operator and call them as if they were static. In...
It seems like method invocation via `verifyInvoked*()` only works on double instances but not for `parent::` method calls. Example: ``` php class ParentClass { public function hello() { echo 'Hello';...
## Bug When you add a file to be mocked to the `includePaths` config the cache isn't updated and you can't mock that class until you manually delete the cache....
One of the classes I'm mocking is called few times along the process and from what I read in the docs, I can only return a single value when defining...