public function fakeMethodsAndRegisterCalls($class, $declaredClass, $method, $params, $static) { // $method = $invocation->getMethod(); // $obj = $invocation->getThis(); $result = __AM_CONTINUE__; if (in_array($method, $this->methodMap)) { $invocation = new \AspectMock\Intercept\MethodInvocation(); $invocation->setThis($class); $invocation->setMethod($method); $invocation->setArguments($params); $invocation->isStatic($static); $invocation->setDeclaredClass($declaredClass); $result = $this->invokeFakedMethods($invocation); } // Record actual method called, not faked method. if (in_array($method, $this->dynamicMethods)) { $method = array_shift($params); $params = array_shift($params); } if (!$static) { if (isset($this->objectMap[spl_object_hash($class)])) { Registry::registerInstanceCall($class, $method, $params); } $class = get_class($class); } if (isset($this->classMap[$class])) { Registry::registerClassCall($class, $method, $params); } return $result; }