lib/Registry/MockRegistry.php
public function register(FunctionProphecy $prophecy)
    {
        $name = $prophecy->getFQName();

        if ($this->has($name)) {
            throw new \Exception();
        }

        if (! function_exists($name)) {
            Generator::generate($prophecy);
        }

        $this->mocks[$name] = $prophecy->getNamespace();

        return $this;
    }
public function register(FunctionProphecy $prophecy)
    {
        $name = $prophecy->getFQName();

        if ($this->has($name)) {
            throw new \Exception();
        }

        if (! function_exists($name)) {
            Generator::generate($prophecy);
        }

        $this->mocks[$name] = $prophecy->getNamespace();

        return $this;
    }
Register a new function prophecy into the registry

@param FunctionProphecy $prophecy

@return $this

@throws \Exception