protected function extendClassCode($methods)
    {
        $code  = 'class ' . $this->mock_class . ' extends ' . $this->class . " {\n";
        $code .= "    protected \$mock;\n";
        $code .= $this->addMethodList($methods);
        $code .= "\n";

        $code .= "    function __construct() {\n";
        $code .= '        $this->mock = new ' . $this->mock_base . "();\n";
        $code .= "        \$this->mock->disableExpectationNameChecks();\n";
        $code .= "    }\n";
        $code .= $this->createCodeForConstructor();
        $code .= $this->chainMockReturns();
        $code .= $this->chainMockExpectations();
        $code .= $this->chainThrowMethods();
        $code .= $this->createCodeForOverridenMethods($methods);
        $code .= "}\n";

        return $code;
    }