Spies & Mocking
Please refer to our MockBox section to take advantage of all the mocking and stubbing you can do. However, every BDD TestBundle has the following functions available to you for mocking and stubbing purposes:
makePublic( target, method, newName )
- Exposes private methods from objects as public methodsquerySim( queryData )
- Simulate a querygetMockBox( [generationPath] )
- Get a reference to MockBoxcreateEmptyMock( [className], [object], [callLogging=true])
- Create an empty mock from a class or objectcreateMock( [className], [object], [clearMethods=false], [callLogging=true])
- Create a spy from an instance or class with call loggingprepareMock( object, [callLogging=true])
- Prepare an instance of an object for method spies with call loggingcreateStub( [callLogging=true], [extends], [implements])
- Create stub objects with call logging and optional inheritance trees and implementation methodsgetProperty( target, name, [scope=variables], [defaultValue] )
- Get a property from an object in any scope
Last updated