Codeception / Codeception/AspectMock
Error: Using $this when not in object context
- Dominant language
- PHP
- Stars
- 784
- Forks
- 132
- PR merge metrics
- No merged PRs in 30d
Description
```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', AdminUserModel::defaultRole());
}
```
```php
cache file generic:
public static function __callStatic($name, $args)
{
if ($name == 'defaultRole') { if (($__am_res = __amock_before($this, __CLASS__, __FUNCTION__, array(), false)) !== __AM_CONTINUE__) return $__am_res;
return "member";
}
}
```
Error message:
```text
1) StubTest::testMagicStaticInherited
Error: Using $this when not in object context
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.