public function testSetHandlerChain() { $this->info->setHandlerChain($this->handlerChain); $this->assertSame($this->handlerChain, $this->info->getHandlerChain()); }
/** * @param $newClassName * @param Phake_CallRecorder_Recorder $recorder * @param Phake_Stubber_StubMapper $mapper * @param Phake_Stubber_IAnswer $defaultAnswer * @return Phake_Mock_Info */ private function createMockInfo($className, Phake_CallRecorder_Recorder $recorder, Phake_Stubber_StubMapper $mapper, Phake_Stubber_IAnswer $defaultAnswer) { $info = new Phake_Mock_Info($className, $recorder, $mapper, $defaultAnswer); $info->setHandlerChain(new Phake_ClassGenerator_InvocationHandler_Composite(array(new Phake_ClassGenerator_InvocationHandler_FrozenObjectCheck($info), new Phake_ClassGenerator_InvocationHandler_CallRecorder($info->getCallRecorder()), new Phake_ClassGenerator_InvocationHandler_MagicCallRecorder($info->getCallRecorder()), new Phake_ClassGenerator_InvocationHandler_StubCaller($info->getStubMapper(), $info->getDefaultAnswer())))); $info->getStubMapper()->mapStubToMatcher(new Phake_Stubber_AnswerCollection(new Phake_Stubber_Answers_StaticAnswer('Mock for ' . $info->getName())), new Phake_Matchers_MethodMatcher('__toString', null)); return $info; }