芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/www/system/tests/kohana/request/client/InternalTest.php
getMock('Request', array('directory', 'controller', 'action', 'uri', 'response'), array($uri)); $request->expects($this->any()) ->method('directory') ->will($this->returnValue($directory)); $request->expects($this->any()) ->method('controller') ->will($this->returnValue($controller)); $request->expects($this->any()) ->method('action') ->will($this->returnValue($action)); $request->expects($this->any()) ->method('uri') ->will($this->returnValue($uri)); $request->expects($this->any()) ->method('response') ->will($this->returnValue($this->getMock('Response'))); $internal_client = new Request_Client_Internal; try { $internal_client->execute($request); } catch(HTTP_Exception_404 $e) { if ($e->getMessage() !== $expected) { $this->fail('Was expecting "'.$expected.'" but got "'.$e->getMessage().'" instead.'); } return; } catch(Kohana_Exception $e) { if ($e->getMessage() !== $expected) { $this->fail('Was expecting "'.$expected.'" but got "'.$e->getMessage().'" instead.'); } return; } $this->fail('A HTTP_Exception_404 or Kohana_Exception exception was expected.'); } }