AspectMock icon indicating copy to clipboard operation
AspectMock copied to clipboard

The most powerful and flexible mocking framework for PHPUnit / Codeception.

Results 42 AspectMock issues
Sort by recently updated
recently updated
newest added

This is for AspectMock 4.1.1. During our migration from PHP 7.4 to PHP 8.1, we've encountered this pattern a few times: When our PHP-Unit tests mock a PHP built-in function...

AspectMock 4.1.1 won't install cleanly under PHP 8 with Composer: ``` $ composer update Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an...

`Redefinition of parameter $_ in /opt/project/new/vendor/lisachenko/go-aop-php/src/Go/Aop/Pointcut/PointcutGrammar.php on line 61` my config in _bootstrap yii2 advanced `require(__DIR__ . '/../vendor/autoload.php'); $kernel = \AspectMock\Kernel::getInstance(); $kernel->init([ 'debug' => true, 'includePaths' => [ __DIR__ ....

the following doesnt' work ``` $ck = test::double(CacheKey::class, [ 'track' => null,])->make(); $cityConfigProvider = new CityConfigProvider($cityConfigBuilder, $ck); // failed for $ck is not an instance of CacheKey $ck->verifyInvoked('track'); $value =...

I use it to mock class for my fuelphp project. But It still uses real class instead of mock class. $user = test::double('\Apply\Model_Apply_Token', [ 'find_one_by' => null, ]); var_dump(Model_Apply_Token::find_one_by('uuid', 12341);

```php namespace app\aspectmockexample; class AdminUserModel extends UserModel { public function save() { $this->name = "Admin_111"; parent::save(); } } ``` ```php testing: public function testMagicStaticInherited() { double::registerClass('app\aspectmockexample\AdminUserModel', ['defaultRole' => 'admin']); TestCase::assertEquals('admin',...

Hey, I've found a bug that if the class itself import as class name instead of using 'self' cause infinite recursion in the test. Like this: ```php class SampleClass {...

Invalid cache files creating when I run tests. In directory file looks like: ``` class Settings { if (($__am_res = __amock_before($this, __CLASS__, __FUNCTION__, array(), false)) !== __AM_CONTINUE__) return $__am_res; ......

It's stated in documentation that `cacheDir` setting can be skipped: https://github.com/Codeception/AspectMock/blob/master/README.md ------ * `cacheDir` a dir where updated source PHP files can be stored. If this directory is not set,...