<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Test::MockObject;
$Test::MockObject::VERSION = '1.20150527';
use strict;
use warnings;

use Scalar::Util qw( blessed refaddr reftype weaken );

sub import
{
    my $self = shift;
    return unless grep /^-debug/, @_;
    eval {
	require UNIVERSAL::isa;
	UNIVERSAL::isa::-&gt;import('verbose');
    };
    eval {
	require UNIVERSAL::can;
	UNIVERSAL::can::-&gt;import('-always_warn');
    };
}

use Test::Builder;

my $Test = Test::Builder-&gt;new();
my (%calls, %subs);

sub new
{
    my ($class, $type) = @_;
    $type ||= {};
    bless $type, $class;
}

sub mock
{
    my ($self, $name, $sub) = @_;
    $sub ||= sub {};

    # leading dash means unlog, otherwise do log
    _set_log( $self, $name, ( $name =~ s/^-// ? 0 : 1 ) );
    _subs( $self )-&gt;{$name} = $sub;

    $self;
}

sub set_isa
{
    my ($self, @supers) = @_;
    my $supers          = _isas( $self );
    $supers-&gt;{$_}       = 1 for @supers;
}

sub set_always
{
    my ($self, $name, $value) = @_;
    $self-&gt;mock( $name, sub { $value } );
}

sub set_true
{
    my $self = shift;

    for my $name ( @_ )
    {
        $self-&gt;mock( $name, sub { 1 } );
    }

    return $self;
}

sub set_false
{
    my $self = shift;

    for my $name ( @_ )
    {
        $self-&gt;mock( $name, sub {} );
    }

    return $self;
}

sub set_list
{
    my ($self, $name, @list) = @_;
    $self-&gt;mock( $name, sub { @{[ @list ]} } );
}

sub set_series
{
    my ($self, $name, @list) = @_;
    $self-&gt;mock( $name, sub { return unless @list; shift @list } );
}

sub set_bound
{
    my ($self, $name, $ref) = @_;

    my %bindings =
    (
        SCALAR =&gt; sub { $$ref },
        ARRAY  =&gt; sub { @$ref },
        HASH   =&gt; sub { %$ref },
    );

    return unless exists $bindings{reftype( $ref )};
    $self-&gt;mock( $name,  $bindings{reftype( $ref )} );
}

# hack around debugging mode being too smart for my sub names
my $old_p;
BEGIN
{
    $old_p  = $^P;
    $^P    &amp;= ~0x200;
}

BEGIN
{
    for my $universal
    ( { sub =&gt; \&amp;_subs, name =&gt; 'can' }, { sub =&gt; \&amp;_isas, name =&gt; 'isa' } )
    {
        my $sub = sub
        {
            my ($self, $sub) = @_;
            local *__ANON__  = $universal-&gt;{name};

            # mockmethods are special cases, class methods are handled directly
            my $lookup = $universal-&gt;{sub}-&gt;( $self );
            return $lookup-&gt;{$sub} if blessed $self and exists $lookup-&gt;{$sub};
            my $parent = 'SUPER::' . $universal-&gt;{name};
            return $self-&gt;$parent( $sub );
        };

        no strict 'refs';
        *{ $universal-&gt;{name} } = $sub;
    }

    $^P = $old_p;
}

sub remove
{
    my ($self, $sub) = @_;
    delete _subs( $self )-&gt;{$sub};
    $self;
}

sub called
{
    my ($self, $sub) = @_;

    for my $called (reverse @{ _calls( $self ) })
    {
        return 1 if $called-&gt;[0] eq $sub;
    }

    return 0;
}

sub clear
{
    my $self             = shift;
    @{ _calls( $self ) } = ();
    $self;
}

sub call_pos
{
    $_[0]-&gt;_call($_[1], 0);
}

sub call_args
{
    return @{ $_[0]-&gt;_call($_[1], 1) };
}

sub _call
{
    my ($self, $pos, $type) = @_;
    my $calls               = _calls( $self );
    return if abs($pos) &gt; @$calls;
    $pos-- if $pos &gt; 0;
    return $calls-&gt;[$pos][$type];
}

sub call_args_string
{
    my $args = $_[0]-&gt;_call( $_[1], 1 ) or return;
    return join($_[2] || '', @$args);
}

sub call_args_pos
{
    my ($self, $subpos, $argpos) = @_;
    my $args = $self-&gt;_call( $subpos, 1 ) or return;
    $argpos-- if $argpos &gt; 0;
    return $args-&gt;[$argpos];
}

sub next_call
{
    my ($self, $num)  = @_;
    $num            ||= 1;

    my $calls = _calls( $self );
    return unless @$calls &gt;= $num;

    my ($call) = (splice(@$calls, 0, $num))[-1];
    return wantarray() ? @$call : $call-&gt;[0];
}

sub AUTOLOAD
{
    our $AUTOLOAD;

    my $self = shift;
    my $sub;
    {
        local $1;
        ($sub) = $AUTOLOAD =~ /::(\w+)\z/;
    }
    return if $sub eq 'DESTROY';

    $self-&gt;dispatch_mocked_method( $sub, @_ );
}

sub dispatch_mocked_method
{
    my $self = $_[0];
    my $sub  = splice( @_, 1, 1 );

    my $subs = _subs( $self );
    if (exists $subs-&gt;{$sub})
    {
        $self-&gt;log_call( $sub, @_ );
        goto &amp;{ $subs-&gt;{$sub} };
    }
    else
    {
        require Carp;
        Carp::carp("Un-mocked method '$sub()' called");
    }

    return;
}

sub log_call
{
    my ($self, $sub, @call_args) = @_;
    return unless _logs( $self, $sub );

    # prevent circular references with weaken
    for my $arg ( @call_args )
    {
        next unless ref $arg;
        weaken( $arg ) if refaddr( $arg ) eq refaddr( $self );
    }

    push @{ _calls( $self ) }, [ $sub, \@call_args ];
}

sub called_ok
{
    my ($self, $sub, $name) = @_;
    $name ||= "object called '$sub'";
    $Test-&gt;ok( $self-&gt;called($sub), $name );
}

sub called_pos_ok
{
    my ($self, $pos, $sub, $name) = @_;
    $name ||= "object called '$sub' at position $pos";
    my $called = $self-&gt;call_pos($pos, $sub);
    unless ($Test-&gt;ok( (defined $called and $called eq $sub), $name ))
    {
        $called = 'undef' unless defined $called;
        $Test-&gt;diag("Got:\n\t'$called'\nExpected:\n\t'$sub'\n");
    }
}

sub called_args_string_is
{
    my ($self, $pos, $sep, $expected, $name) = @_;
    $name ||= "object sent expected args to sub at position $pos";
    $Test-&gt;is_eq( $self-&gt;call_args_string( $pos, $sep ), $expected, $name );
}

sub called_args_pos_is
{
    my ($self, $pos, $argpos, $arg, $name) = @_;
    $name ||= "object sent expected arg '$arg' to sub at position $pos";
    $Test-&gt;is_eq( $self-&gt;call_args_pos( $pos, $argpos ), $arg, $name );
}

sub fake_module
{
    my ($class, $modname, %subs) = @_;

    if ($class-&gt;check_class_loaded( $modname ) and ! keys %subs)
    {
        require Carp;
        Carp::croak( "No mocked subs for loaded module '$modname'" );
    }

    $modname =~ s!::!/!g;
    $INC{ $modname . '.pm' } = 1;

    no warnings 'redefine';
    {
        no strict 'refs';
        ${ $modname . '::' }{VERSION} ||= -1;
    }

    for my $sub (keys %subs)
    {
        my $type = reftype( $subs{ $sub } ) || '';
        unless ( $type eq 'CODE' )
        {
            require Carp;
            Carp::carp("'$sub' is not a code reference" );
            next;
        }
        no strict 'refs';
        *{ $_[1] . '::' . $sub } = $subs{ $sub };
    }
}

sub check_class_loaded
{
    my ($self, $class, $load_flag) = @_;

    (my $path    = $class) =~ s{::}{/}g;
    return 1 if exists $INC{ $path . '.pm' };

    my $symtable = \%main::;
    my $found    = 1;

    for my $symbol ( split( '::', $class ))
    {
        unless (exists $symtable-&gt;{ $symbol . '::' })
        {
            $found = 0;
            last;
        }

        $symtable = $symtable-&gt;{ $symbol . '::' };
    }

    return $found;
}

sub fake_new
{
    my ($self, $class) = @_;
    $self-&gt;fake_module( $class, new =&gt; sub { $self } );
}

sub DESTROY
{
    my $self = shift;
    $self-&gt;_clear_calls();
    $self-&gt;_clear_subs();
    $self-&gt;_clear_logs();
    $self-&gt;_clear_isas();
}

sub _get_key
{
    my $invocant = shift;
    return blessed( $invocant ) ? refaddr( $invocant ) : $invocant;
}

{
    my %calls;

    sub _calls
    {
        $calls{ _get_key( shift ) } ||= [];
    }

    sub _clear_calls
    {
        delete $calls{ _get_key( shift ) };
    }
}

{
    my %subs;

    sub _subs
    {
        $subs{ _get_key( shift ) } ||= {};
    }

    sub _clear_subs
    {
        delete $subs{ _get_key( shift ) };
    }
}

{
    my %logs;

    sub _set_log
    {
        my $key          = _get_key( shift );
        my ($name, $log) = @_;

        $logs{$key} ||= {};

        if ($log)
        {
            $logs{$key}{$name} = 1;
        }
        else
        {
            delete $logs{$key}{$name};
        }
    }

    sub _logs
    {
        my $key    = _get_key( shift );
        my ($name) = @_;
        return exists $logs{$key}{$name};
    }

    sub _clear_logs
    {
        delete $logs{ _get_key( shift ) };
    }
}

{
    my %isas;

    sub _isas
    {
        $isas{ _get_key( shift ) } ||= {};
    }

    sub _clear_isas
    {
        delete $isas{ _get_key( shift ) };
    }
}

1;

__END__

=head1 NAME

Test::MockObject - Perl extension for emulating troublesome interfaces

=head1 SYNOPSIS

  use Test::MockObject;
  my $mock = Test::MockObject-&gt;new();
  $mock-&gt;set_true( 'somemethod' );
  ok( $mock-&gt;somemethod() );

  $mock-&gt;set_true( 'veritas')
       -&gt;set_false( 'ficta' )
       -&gt;set_series( 'amicae', 'Sunny', 'Kylie', 'Bella' );

=head1 DESCRIPTION

It's a simple program that doesn't use any other modules, and those are easy to
test.  More often, testing a program completely means faking up input to
another module, trying to coax the right output from something you're not
supposed to be testing anyway.

Testing is a lot easier when you can control the entire environment.  With
Test::MockObject, you can get a lot closer.

Test::MockObject allows you to create objects that conform to particular
interfaces with very little code.  You don't have to reimplement the behavior,
just the input and the output.

=head2 IMPORTANT CAVEATS

Before you go wild with your testing powers, consider three caveats:

=over 4

=item * It is possible to write highly detailed unit tests that pass even when
your integration tests may fail.  Testing the pieces individually does not
excuse you from testing the whole thing together.

=item * In cases where you only need to mock one or two pieces of an existing
module, consider L&lt;Test::MockObject::Extends&gt; instead.

=item * If the code under testing produces strange errors about type checks,
pass the C&lt;-debug&gt; flag when using C&lt;Test::MockObject&gt; or
C&lt;Test::MockObject::Extends&gt;. This will load both L&lt;UNIVERSAL::isa&gt; and
L&lt;UNIVERSAL::can&gt; to perform additional debugging on the incorrect use of both
methods from the L&lt;UNIVERSAL&gt; package. (This behavior used to be active by
default, but that was, however correct, probably a burden to onerous for the
CPAN.)

=back

=head2 EXPORT

None.

=head2 METHODS

The most important thing a Mock Object can do is to conform sufficiently to an
interface.  For example, if you're testing something that relies on CGI.pm, you
may find it easier to create a mock object that returns controllable results
at given times than to fake query string input.

=head3 The Basics

=over 4

=item * C&lt;new&gt;

Creates a new mock object.  By default, this is a blessed hash.  Pass a
reference to bless that reference.

    my $mock_array  = Test::MockObject-&gt;new( [] );
    my $mock_scalar = Test::MockObject-&gt;new( \( my $scalar ) );
    my $mock_code   = Test::MockObject-&gt;new( sub {} );
    my $mock_glob   = Test::MockObject-&gt;new( \*GLOB );

=back

=head3 Mocking

Your mock object is nearly useless if you don't tell it what it's mocking.
This is done by installing methods.  You control the output of these mocked
methods.  In addition, any mocked method is tracked.  You can tell not only
what was called, but which arguments were passed.  Please note that you cannot
track non-mocked method calls.  They will still be allowed, though
Test::MockObject will carp() about them.  This is considered a feature, though
it may be possible to disable this in the future.

As implied in the example above, it's possible to chain these calls together.
Thanks to a suggestion from the fabulous Piers Cawley (CPAN RT #1249), this
feature came about in version 0.09.  Shorter testing code is nice!

=over 4

=item * C&lt;mock(I&lt;name&gt;, I&lt;coderef&gt;)&gt;

Adds a coderef to the object.  This allows code to call the named method on the
object.  For example, this code:

    my $mock = Test::MockObject-&gt;new();
    $mock-&gt;mock( 'fluorinate',
        sub { 'impurifying precious bodily fluids' } );
    print $mock-&gt;fluorinate;

will print a helpful warning message.  Please note that methods are only added
to a single object at a time and not the class.  (There is no small similarity
to the Self programming language or the L&lt;Class::Prototyped&gt; module.)

This method forms the basis for most of Test::MockObject's testing goodness.

B&lt;Please Note:&gt; this method used to be C&lt;add()&gt;.  Due to its ambiguity, it now
has a different spelling.  For backwards compatibility purposes, add() is
available, though version 0.07 deprecated it.  It goes to some contortions to
try to do what you mean, but I make few guarantees.

=item * C&lt;fake_module(I&lt;module name&gt;), [ I&lt;subname&gt; =&gt; I&lt;coderef&gt;, ... ]

B&lt;Note:&gt; See L&lt;Test::MockModule&gt; for an alternate (and better) approach.

Lies to Perl that it has already loaded a named module.  This is handy when
providing a mockup of a real module if you'd like to prevent the actual module
from interfering with the nice fakery.  If you're mocking L&lt;Regexp::English&gt;,
say:

    $mock-&gt;fake_module( 'Regexp::English' );

This is both a class and as an object method.  Beware that this must take place
before the actual module has a chance to load.  Either wrap it in a BEGIN block
before a use or require or place it before a C&lt;use_ok()&gt; or C&lt;require_ok()&gt;
call.

You can optionally add functions to the mocked module by passing them as name
=&gt; coderef pairs to C&lt;fake_module()&gt;.  This is handy if you want to test an
C&lt;import()&gt;:

    my $import;
    $mock-&gt;fake_module(
        'Regexp::English',
        import =&gt; sub { $import = caller }
    );
    use_ok( 'Regexp::Esperanto' );
    is( $import, 'Regexp::Esperanto',
        'Regexp::Esperanto should use() Regexp::English' );

If you use C&lt;fake_module()&gt; to mock a module that already exists in memory --
one you've loaded elsewhere perhaps, but do not pass any subroutines to mock,
this method will throw an exception.  This is because if you call the
constructor later on, you probably won't get a mock object back and you'll be
confused.

=item * C&lt;fake_new(I&lt;module name&gt;)&gt;

B&lt;Note:&gt; see L&lt;Test::MockObject::Extends&gt; for a better alternative to this
method.

Provides a fake constructor for the given module that returns the invoking mock
object.  Used in conjunction with C&lt;fake_module()&gt;, you can force the tested
unit to work with the mock object instead.

    $mock-&gt;fake_module( 'CGI' );
    $mock-&gt;fake_new( 'CGI' );

    use_ok( 'Some::Module' );
    my $s = Some::Module-&gt;new();
    is( $s-&gt;{_cgi}, $mock,
        'new() should create and store a new CGI object' );

=item * C&lt;set_always(I&lt;name&gt;, I&lt;value&gt;)&gt;

Adds a method of the specified name that always returns the specified value.

=item * C&lt;set_true(I&lt;name_1&gt;, I&lt;name_2&gt;, ... I&lt;name_n&gt;)&gt;

Adds a method of the specified name that always returns a true value.  This can
take a list of names.

=item * C&lt;set_false(I&lt;name_1&gt;, I&lt;name_2&gt;, ... I&lt;name_n&gt;)&gt;

Adds a method of the specified name that always returns a false value.  (Since
it installs an empty subroutine, the value should be false in both scalar and
list contexts.)  This can take a list of names.

=item * C&lt;set_list(I&lt;name&gt;, [ I&lt;item1&gt;, I&lt;item2&gt;, ... ]&gt;

Adds a method that always returns a given list of values.  It takes some care
to provide a list and not an array, if that's important to you.

=item * C&lt;set_series(I&lt;name&gt;, [ I&lt;item1&gt;, I&lt;item2&gt;, ... ]&gt;

Adds a method that will return the next item in a series on each call.  This
can help to test error handling, by forcing a failure on the first method call
and then subsequent successes.  Note that the series does not repeat; it will
eventually run out.

=item * C&lt;set_bound(I&lt;name&gt;, I&lt;reference&gt;)&gt;

Adds a method bound to a variable.  Pass in a reference to a variable in your
test.  When you change the variable, the return value of the new method will
change as well.  This is often handier than replacing mock methods.

=item * C&lt;set_isa( I&lt;name1&gt;, I&lt;name2&gt;, ... I&lt;namen&gt; )&gt;

Adds an apparent parent to the module, so that calling C&lt;isa()&gt; on the mock
will return true appropriately.  Sometimes you really need this.

=item * C&lt;remove(I&lt;name&gt;)&gt;

Removes a named method.

=back

=head3 Checking Your Mocks

=over 4

=item * C&lt;can( $method_name )&gt;

Returns a subroutine reference if this particular mocked object can handle the
named method, false otherwise.

=item * C&lt;isa( $class_name )&gt;

Returns true if the invocant object mocks a particular class.  You must have
used C&lt;set_isa()&gt; first.

=item * C&lt;called(I&lt;name&gt;)&gt;

Checks to see if something has called a named method on the object.  This
returns a boolean value.  The current implementation does not scale especially
well, so use this sparingly if you need to search through hundreds of calls.

=item * C&lt;clear()&gt;

Clears the internal record of all method calls on the object.  It's handy to do
this every now and then.  Note that this does not affect the mocked methods,
only all of the methods called on the object to this point.

It's handy to C&lt;clear()&gt; methods in between series of tests.  That makes it
much easier to call C&lt;next_method()&gt; without having to skip over the calls from
the last set of tests.

=item * C&lt;next_call([ I&lt;position&gt; ])&gt;

Returns the name and argument list of the next mocked method called on an
object, in list context.  In scalar context, returns only the method name.
There are two important things to know about this method.  First, it starts at
the beginning of the call list.  If your code runs like this:

    $mock-&gt;set_true( 'foo' );
    $mock-&gt;set_true( 'bar' );
    $mock-&gt;set_true( 'baz' );

    $mock-&gt;foo();
    $mock-&gt;bar( 3, 4 );
    $mock-&gt;foo( 1, 2 );

Then you might see output of:

    my ($name, $args) = $mock-&gt;next_call();
    print "$name (@$args)";

    # prints 'foo'

    $name = $mock-&gt;next_call();
    print $name;

    # prints 'bar'

    ($name, $args) = $mock-&gt;next_call();
    print "$name (@$args)";

    # prints 'foo 1 2'

If you provide an optional number as the I&lt;position&gt; argument, the method will
skip that many calls, returning the data for the last one skipped.

    $mock-&gt;foo();
    $mock-&gt;bar();
    $mock-&gt;baz();

    $name = $mock-&gt;next_call();
    print $name;

    # prints 'foo'

    $name = $mock-&gt;next_call( 2 );
    print $name

    # prints 'baz'

When it reaches the end of the list, it returns undef.  This is probably the
most convenient method in the whole module, but for the sake of completeness
and backwards compatibility (it takes me a while to reach the truest state of
laziness!), there are several other methods.

=item * C&lt;call_pos(I&lt;position&gt;)&gt;

Returns the name of the method called on the object at a specified position.
This is handy if you need to test a certain order of calls.  For example:

    Some::Function( $mock );
    is( $mock-&gt;call_pos(1),  'setup',
        'Function() should first call setup()' );
    is( $mock-&gt;call_pos(-1), 'end',
        '... and last call end()' );

Positions can be positive or negative.  Please note that the first position is,
in fact, 1.  (This may change in the future.  I like it, but am willing to
reconsider.)

=item * C&lt;call_args(I&lt;position&gt;)&gt;

Returns a list of the arguments provided to the method called at the appropriate
position.  Following the test above, one might say:

    is( ($mock-&gt;call_args(1))[0], $mock,
        '... passing the object to setup()' );
    is( scalar $mock-&gt;call_args(-1), 0,
        '... and no args to end()' );

=item * C&lt;call_args_pos(I&lt;call position&gt;, I&lt;argument position&gt;)&gt;

Returns the argument at the specified position for the method call at the
specified position.  One might rewrite the first test of the last example as:

    is( $mock-&gt;call_args_pos(1, 1), $mock,
        '... passing the object to setup()');

=item * C&lt;call_args_string(I&lt;position&gt;, [ I&lt;separator&gt; ])&gt;

Returns a stringified version of the arguments at the specified position.  If
no separator is given, they will not be separated.  This can be used as:

    is( $mock-&gt;call_args_string(1), "$mock initialize",
        '... passing object, initialize as arguments' );

=item * C&lt;called_ok(I&lt;method name&gt;, [ I&lt;test name&gt; ])&gt;

Tests to see whether a method of the specified name has been called on the
object.  This and the following methods use Test::Builder, so they integrate
nicely with a test suite built around Test::Simple, Test::More, or anything
else compatible:

    $mock-&gt;foo();
    $mock-&gt;called_ok( 'foo' );

A generic default test name is provided.

=item * C&lt;called_pos_ok(I&lt;position&gt;, I&lt;method name&gt;, [ I&lt;test name&gt; ])&gt;

Tests to see whether the named method was called at the specified position.  A
default test name is provided.

=item * C&lt;called_args_pos_is(I&lt;method position&gt;, I&lt;argument position&gt;, I&lt;expected&gt;, [ I&lt;test name&gt; ])&gt;

Tests to see whether the argument at the appropriate position of the method in
the specified position equals a specified value.  A default, rather
non-descript test name is provided.

=item * C&lt;called_args_string_is(I&lt;method position&gt;, I&lt;separator&gt;, I&lt;expected&gt;, [ I&lt;test name&gt; ])&gt;

Joins together all of the arguments to a method at the appropriate position and
matches against a specified string.  A generically bland test name is provided
by default.  You can probably do much better.

=item * C&lt;check_class_loaded( $class_name )&gt;

Attempts to determine whether you have a class of the given name loaded and
compiled.  Returns true or false.

=back

=head3 Logging

Test::MockObject logs all mocked methods by default.  Sometimes you don't want
to do this.  To prevent logging all calls to a given method, prepend the name
of the method with C&lt;-&gt; when mocking it.

That is:

    $mock-&gt;set_true( '-foo', 'bar' );

will set mock both C&lt;foo()&gt; and C&lt;bar()&gt;, causing both to return true.
However, the object will log only calls to C&lt;bar()&gt;, not C&lt;foo()&gt;.  To log
C&lt;foo()&gt; again, merely mock it again without the leading C&lt;-&gt;:

    $mock-&gt;set_true( 'foo' );

C&lt;$mock&gt; will log all subsequent calls to C&lt;foo()&gt; again.

=head3 Subclassing

There are two methods provided for subclassing:

=over 4

=item * C&lt;dispatch_mocked_method( $method_name, @_ )&gt;

This method determines how to call a method (named as C&lt;$method_name&gt;) not
available in this class.  It also controls logging.  You may or may not find it
useful, but I certainly take advantage of it for Test::MockObject::Extends.

=item * C&lt;log_call( $method_name, @_ )&gt;

This method tracks the call of the named method and its arguments.

=back

=head1 TODO

=over 4

=item * Add a factory method to avoid namespace collisions (soon)

=item * Add more useful methods (catch C&lt;import()&gt;?)

=back

=head1 AUTHOR

chromatic, E&lt;lt&gt;chromatic at wgz dot orgE&lt;gt&gt;

Thanks go to Curtis 'Ovid' Poe, as well as ONSITE! Technology, Inc., for
finding several bugs and providing several constructive suggestions.

Jay Bonci also found a false positive in C&lt;called_ok()&gt;.  Thanks!

Chris Winters was the first to report I'd accidentally scheduled 0.12 for
deletion without uploading a newer version.  He also gave useful feedback on
Test::MockObject::Extends.

Stevan Little provided the impetus and code for C&lt;set_isa()&gt;.

Nicholas Clark found a documentation error.

Mutant suggested a potential problem with fake_module().

=head1 SEE ALSO

L&lt;perl&gt;, L&lt;Test::Tutorial&gt;, L&lt;Test::More&gt;,
L&lt;http:E&lt;sol&gt;E&lt;sol&gt;www.perl.comE&lt;sol&gt;pubE&lt;sol&gt;aE&lt;sol&gt;2001E&lt;sol&gt;12E&lt;sol&gt;04E&lt;sol&gt;testing.html&gt;,
and
L&lt;http:E&lt;sol&gt;E&lt;sol&gt;www.perl.comE&lt;sol&gt;pubE&lt;sol&gt;aE&lt;sol&gt;2002E&lt;sol&gt;07E&lt;sol&gt;10E&lt;sol&gt;tmo.html&gt;.

=head1 COPYRIGHT

Copyright (c) 2002 - 2011 by chromatic E&lt;lt&gt;chromatic at wgz dot orgE&lt;gt&gt;.

This program is free software; you can use, modify, and redistribute it under
the same terms as Perl 5.10.x itself.

See http://www.perl.com/perl/misc/Artistic.html

=cut
</pre></body></html>