NAME

Test::Magpie::Mock - A mock object

DESCRIPTION

Mock objects are the objects you pass around as if they were real objects. They do not have a defined API; any method call is valid. A mock on its own is in record mode - method calls and arguments will be saved. You can switch temporarily to stub and verification mode with when and verify in Test::Magpie, respectively.

ATTRIBUTES

stubs

This attribute is internal, and not publically accessible.

Returns a map of method name to stub array references. Stubs are matched against invocation arguments to determine which stub to dispatch to.

invocations

This attribute is internal, and not publically accessible.

Returns an array reference of all method invocations on this mock.

METHODS

isa $class

Forced to return true for any package

does $role

Forced to return true for any role

AUTHOR

Oliver Charles

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Oliver Charles <oliver.g.charles@googlemail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.