<< Previous Contents Next >>

Side-effect Example: Use the mock in our test

my %session_data = (
    user_id    => 55,
    cart_items => 3,
    cart_total => 55.77
);
MyWebUtils->set_session_manager(
    Mock::SessionManager->new( %session_data )
);
# ...exercise application which will read our
# specified session values