We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
namespace app\aspectmockexample; class AdminUserModel extends UserModel { public function save() { $this->name = "Admin_111"; parent::save(); } }
testing: public function testMagicStaticInherited() { double::registerClass('app\aspectmockexample\AdminUserModel', ['defaultRole' => 'admin']); TestCase::assertEquals('admin', AdminUserModel::defaultRole()); }
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:
1) StubTest::testMagicStaticInherited Error: Using $this when not in object context
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Error message:
The text was updated successfully, but these errors were encountered: