phpDocumentor Gallery
PHPUnit
[ class tree: Gallery ] [ index: Gallery ] [ all elements ]

Class: MockObject

Source Location: /lib/tools/phpunit/MockObject.class

Class MockObject

Class Overview

Base class for mock objects (UnitTestStorage, UnitTestPlatform and UnitTestPhpVm) that provides an easy way to specify the replies for a call sequence.

To mock up an individual class, extend MockObject and then mimic the API that you want to mock. The body of each mimicked method should contain a call to MockObject::_makeReply, like this:

function describeMap($mapName, $tryAllModules=false) { return $this->_makeReply('describeMap', array($mapName, $tryAllModules)); }

Located in /lib/tools/phpunit/MockObject.class [line 53]



		
		
		
		

Methods

[ Top ]
Direct descendents
Child Class Description
AdminSlideshowControllerTest_MockPicLensHelper
UnitTestPhpVm Unit test GalleryPhpVm. This is a mock GalleryPhpVm that the unit tests can use to simulate the exact conditions that they want from the php vm in order to exercise the code.
UnitTestPlatform Unit test platform. This is a mock platform that the unit tests can use to simulate the exact conditions that they want from the platform in order to exercise the code.
UnitTestStorage Unit test storage. This is a mock storage that the unit tests can use to simulate the exact conditions that they want from the storage in order to exercise the code.
UnitTestStorageExtras
UnitTestRepository Unit test repository. This is a mock repository that the unit tests can use to simulate the exact conditions that they want from the repository in order to exercise the code.
UnitTestRepositoryUtilities Unit test repository utilties. This is a mock RepositoryUtilties class that the unit tests can use to simulate the exact conditions that they want from the repository utilties in order to exercise the code.

[ Top ]
Method Summary
MockObject   MockObject()  
void   getCalled()  
void   getRemaining()  
void   isComplete()  
void   setReply()  
void   _makeReply()  
void   _parametersMatch()  

[ Top ]
Methods
Constructor MockObject  [line 54]

  MockObject MockObject( )



[ Top ]
getCalled  [line 104]

  void getCalled( $function  )

Parameters:
   $function: 


[ Top ]
getRemaining  [line 74]

  void getRemaining( )



Redefined in descendants as:

[ Top ]
isComplete  [line 64]

  void isComplete( )



Redefined in descendants as:

[ Top ]
setReply  [line 59]

  void setReply( $function, $inputs, $outputs, [ $optional = false]  )

Parameters:
   $function: 
   $inputs: 
   $outputs: 
   $optional: 


Redefined in descendants as:

[ Top ]
_makeReply  [line 80]

  void _makeReply( $function, $request  )

Parameters:
   $function: 
   $request: 


[ Top ]
_parametersMatch  [line 108]

  void _parametersMatch( $expected, $actual  )

Parameters:
   $expected: 
   $actual: 


[ Top ]

Documentation generated on Fri, 03 Oct 2008 05:42:16 -0700 by phpDocumentor 1.3.0RC6