Codeception / Codeception/AspectMock
Error: Using $this when not in object context
- Lenguaje dominante
- PHP
- Estrellas
- 784
- Forks
- 132
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
```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
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.